Skip to content

Commit 00da491

Browse files
zsdonghaowagamamaz
authored andcommitted
Update prepro.py (#917)
* Update prepro.py tl.prepro.imresize supports different number of channel. * Update prepro.py
1 parent b49742c commit 00da491

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tensorlayer/prepro.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,11 +1852,9 @@ def imresize(x, size=None, interp='bicubic', mode=None):
18521852
# greyscale
18531853
x = scipy.misc.imresize(x[:, :, 0], size, interp=interp, mode=mode)
18541854
return x[:, :, np.newaxis]
1855-
elif x.shape[-1] == 3:
1856-
# rgb, bgr ..
1857-
return scipy.misc.imresize(x, size, interp=interp, mode=mode)
18581855
else:
1859-
raise Exception("Unsupported channel %d" % x.shape[-1])
1856+
# rgb, bgr, rgba
1857+
return scipy.misc.imresize(x, size, interp=interp, mode=mode)
18601858

18611859

18621860
# value scale

0 commit comments

Comments
 (0)