Skip to content

Commit

Permalink
update caffe.io to remove warnings
Browse files Browse the repository at this point in the history
1. /u/relauto/.TOOLS_ROOT/ToolsCommon/SynopsysCaffe/S-2021.06-rc1-nocuda/Linux/lib/python3.6/site-packages/skimage/io/_io.py:49: UserWarning: `as_grey` has been deprecated in favor of `as_gray`
  warn('`as_grey` has been deprecated in favor of `as_gray`')
2. /u/relauto/.TOOLS_ROOT/ToolsCommon/SynopsysCaffe/S-2021.06-rc1-nocuda/Linux/lib/python3.6/site-packages/skimage/transform/_warps.py:110: UserWarning: Anti-aliasing will be enabled by default in skimage 0.15 to avoid aliasing artifacts when down-sampling images.
  warn("Anti-aliasing will be enabled by default in skimage 0.15 to "
  • Loading branch information
minglu2019 authored Jul 19, 2021
1 parent 47d022a commit 3c2d549
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/caffe/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def load_image(filename, color=True):
of size (H x W x 3) in RGB or
of size (H x W x 1) in grayscale.
"""
img = skimage.img_as_float(skimage.io.imread(filename, as_grey=not color)).astype(np.float32)
img = skimage.img_as_float(skimage.io.imread(filename, as_gray=not color)).astype(np.float32)
if img.ndim == 2:
img = img[:, :, np.newaxis]
if color:
Expand Down Expand Up @@ -329,7 +329,7 @@ def resize_image(im, new_dims, interp_order=1):
# skimage is fast but only understands {1,3} channel images
# in [0, 1].
im_std = (im - im_min) / (im_max - im_min)
resized_std = resize(im_std, new_dims, order=interp_order, mode='constant')
resized_std = resize(im_std, new_dims, order=interp_order, mode='constant', anti_aliasing=None)
resized_im = resized_std * (im_max - im_min) + im_min
else:
# the image is a constant -- avoid divide by 0
Expand Down

0 comments on commit 3c2d549

Please sign in to comment.