Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RandomResize does not work with ndarray #22

Open
zhaoyig opened this issue Dec 17, 2022 · 0 comments
Open

RandomResize does not work with ndarray #22

zhaoyig opened this issue Dec 17, 2022 · 0 comments

Comments

@zhaoyig
Copy link

zhaoyig commented Dec 17, 2022

\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()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant