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

replace the method of "misc.imresize(img, self.size, self.interpolation, 'F')" #44

Open
Rander2002 opened this issue Jan 15, 2024 · 2 comments

Comments

@Rander2002
Copy link

the function of "scipy.misc" is be used at dataloaders/transforms.py.
now, the function of "scipy.misc" has been discarded, i look for the function of "skimage.transform.resize" to replace it.
but when i replace it, the code get am error: 'float' object is not iterable.
Is there any way to fix this, or is there any other functions that can replace the "scipy.misc" function.
thanks.

@hjd-hitsz
Copy link

you can from scipy import ndimage and replace
misc.imresize(img, self.size, self.interpolation) with ndimage.zoom(img, (self.size, self.size, 1), order=0)
misc.imresize(img, self.size, self.interpolation, 'F') with ndimage.zoom(img, (self.size, self.size), order=0)
itpl.rotate(img, self.angle, reshape=False, prefilter=False, order=0) with ndimage.rotate(img, angle=self.angle, reshape=False, prefilter=False, order=0)

@Rander2002
Copy link
Author

you can from scipy import ndimage and replace misc.imresize(img, self.size, self.interpolation) with ndimage.zoom(img, (self.size, self.size, 1), order=0) misc.imresize(img, self.size, self.interpolation, 'F') with ndimage.zoom(img, (self.size, self.size), order=0) itpl.rotate(img, self.angle, reshape=False, prefilter=False, order=0) with ndimage.rotate(img, angle=self.angle, reshape=False, prefilter=False, order=0)

ok!, i get it. thank for your reply,. hope you happy every day!

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

2 participants