rezazad68 / BCDU-Net

BCDU-Net : Medical Image Segmentation
712 stars 264 forks source link

skimage.transform.resize is slower than scipy.misc.imresize #17

Closed asifehmad closed 4 years ago

asifehmad commented 4 years ago

while training for the skin images data set on Google Colab I came across errors in a data preparation section. where this line: img = np.double(sc.imresize(img, [height, width, channels], interp='bilinear', mode = 'RGB'))

and this line: img2 = np.double(sc.imresize(img2, [height, width], interp='bilinear'))

showed errors, as scipy.misc.imresize is deprecated in newer versions of scipy. What I did is I used skimage.transform.resize instead of scipy.misc.imresize, that's what is recommended, as:

img = np.double(resize(img, (height, width, channels)))

Here I have imported resize from skimage.transform and img2 = np.double(resize(img2, (height, width)))

It worked. But the problem is the data reading process has become very slow as compared to the scipy.misc.imresize. I had tested it before on old version of scipy.misc.imresize. Any help in this regard would be very much appreciated. Thanks!

asifehmad commented 4 years ago

while training for the skin images data set on Google Colab I came across errors in a data preparation section. where this line: img = np.double(sc.imresize(img, [height, width, channels], interp='bilinear', mode = 'RGB'))

and this line: img2 = np.double(sc.imresize(img2, [height, width], interp='bilinear'))

showed errors, as scipy.misc.imresize is deprecated in newer versions of scipy. What I did is I used skimage.transform.resize instead of scipy.misc.imresize, that's what is recommended, as:

img = np.double(resize(img, (height, width, channels)))

Here I have imported resize from skimage.transform and img2 = np.double(resize(img2, (height, width)))

It worked. But the problem is the data reading process has become very slow as compared to the scipy.misc.imresize. I had tested it before on old version of scipy.misc.imresize. Any help in this regard would be very much appreciated. Thanks!

Or any alternate way of reading the images would be helpful. The reading process in this way has taken more than 2 hours.

asifehmad commented 4 years ago

I just copied and pasted the code in this Link before the execution of Prepare_ISIC2018.py and it worked. I had not to downgrade scipy to its old version after this.