dwofk / fast-depth

ICRA 2019 "FastDepth: Fast Monocular Depth Estimation on Embedded Systems"
MIT License
926 stars 189 forks source link

module **scipy.misc** has no attribute *imresize* #51

Closed LulaSan closed 3 years ago

LulaSan commented 3 years ago

Hi, imresize is deprecated or removed. You may consider changing it using Pillow instead: numpy.array(Image.fromarray(arr).resize()). The error happens in transforms.py ,line 338

LulaSan commented 3 years ago

I change the code like that: `

def call(self, img): """ Args: img (PIL Image): Image to be scaled. Returns: PIL Image: Rescaled image. """ if img.ndim == 3: im = Image.fromarray(img) size = tuple((np.array(im.size) * self.size).astype(int)) new_image = np.array(im.resize(size, Image.NEAREST)) return new_image elif img.ndim == 2:

return misc.imresize(img, self.size, self.interpolation, 'F')

        im = Image.fromarray(img)
        size = tuple((np.array(im.size) * self.size).astype(int))
        new_image = np.array(im.resize(size, Image.NEAREST))
        return new_image
    else:
        RuntimeError('img should be ndarray with 2 or 3 dimensions. Got {}'.format(img.ndim))

`