sparse-to-dense.pytorch icon indicating copy to clipboard operation
sparse-to-dense.pytorch copied to clipboard

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

Open Rander2002 opened this issue 1 year ago • 2 comments

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.

Rander2002 avatar Jan 15 '24 02:01 Rander2002

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)

hjd-hitsz avatar Jan 24 '24 15:01 hjd-hitsz

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!

Rander2002 avatar Feb 20 '24 13:02 Rander2002