ml4a / ml4a

A python library and collection of notebooks for making art with machine learning.

Home Page:https://ml4a.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Scipy depricated imread

granthoff1107 opened this issue · comments

In the Lapnorm.py file the load image calls scipy.misc.imread

def load_image(path, h, w):
    img0 = scipy.misc.imread(path, mode='RGB')
    img0 = scipy.misc.imresize(img0, (h, w)).astype('float64')
    return img0

See this issue for reference
https://stackoverflow.com/questions/15345790/scipy-misc-module-has-no-attribute-imread

It looks like there should be a simple way to replace that with the new image loading, I'm not too familiar with python or what that imread normally returns.

I'll submit a fix for in when I figure everything out

I fixed it here 👍

def load_image(path, h, w):
    img0 = imageio.imread(path, as_gray=False, pilmode="RGB")
    img0 = np.array(PIL.Image.fromarray(img0).resize((h, w))).astype('float64')
    return img0