Skip to content

problem in data_loader.py #9

@TheStoneMX

Description

@TheStoneMX

in the static function load_img() you are using SciPy.misc.imread() which is deprecated in SciPy 1.0.0, and removed in 1.2.0... and the lattes version is 1.2.2
in order for the code to work, I had to do this.

@staticmethod
def load_img(image_files):

images = []

for image_file in image_files:
  _, extension = os.path.splitext(image_file)
  extension = extension.lower()
  
  if extension == ".png":
    im = Image.open(image_file)
    imarray = np.array(im)
    images.append(imarray)
    #image = misc.imread(image_file)
    #images.append(image)
  elif extension == ".tif":
    im = Image.open(image_file)
    imarray = np.array(im)
    images.append(imarray)
  else:
    raise ValueError("Unsupported image filetype for %s" % image_file)
return np.array(images)

Besides I don't understand why you are using to read images functions from to different libraries.....

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions