Skip to content

RandomResize does not work with ndarray #22

@zhaoyig

Description

@zhaoyig
\lib\site-packages\vidaug\augmentors\affine.py in __call__(self, clip)
     90         new_size = (new_h, new_w)
     91         if isinstance(clip[0], np.ndarray):
---> 92             return [scipy.misc.imresize(img, size=(new_h, new_w),interp=self.interpolation) for img in clip]
     93         elif isinstance(clip[0], PIL.Image.Image):
     94             return [img.resize(size=(new_w, new_h), resample=self._get_PIL_interp(self.interpolation)) for img in clip]

\site-packages\vidaug\augmentors\affine.py in <listcomp>(.0)
     90         new_size = (new_h, new_w)
     91         if isinstance(clip[0], np.ndarray):
---> 92             return [scipy.misc.imresize(img, size=(new_h, new_w),interp=self.interpolation) for img in clip]
     93         elif isinstance(clip[0], PIL.Image.Image):
     94             return [img.resize(size=(new_w, new_h), resample=self._get_PIL_interp(self.interpolation)) for img in clip]

AttributeError: module 'scipy.misc' has no attribute 'imresize'

When trying to use RandomResize it gives the above error. Seems to be caused by deprecated scipy API.

imresize is deprecated! imresize is deprecated in SciPy 1.0.0, and will be removed in 1.3.0. Use Pillow instead: numpy.array(Image.fromarray(arr).resize()).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions