sparse-to-dense.pytorch
sparse-to-dense.pytorch copied to clipboard
replace the method of "misc.imresize(img, self.size, self.interpolation, 'F')"
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.
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)
you can
from scipy import ndimageand replacemisc.imresize(img, self.size, self.interpolation)withndimage.zoom(img, (self.size, self.size, 1), order=0)misc.imresize(img, self.size, self.interpolation, 'F')withndimage.zoom(img, (self.size, self.size), order=0)itpl.rotate(img, self.angle, reshape=False, prefilter=False, order=0)withndimage.rotate(img, angle=self.angle, reshape=False, prefilter=False, order=0)
ok!, i get it. thank for your reply,. hope you happy every day!