Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Anirudh Acharya committed Oct 18, 2018
1 parent 58f2636 commit a35fcc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/mxnet/image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def imresize(src, w, h, interp):
r"""Resize image with OpenCV.
Note: `imread` uses OpenCV (not the CV2 Python library).
MXNet must have been built with USE_OPENCV=1 for `imdecode` to work.
MXNet must have been built with USE_OPENCV=1 for `imresize` to work.
Parameters
----------
Expand Down
8 changes: 5 additions & 3 deletions tests/python/unittest/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_imdecode(self):
try:
import cv2
except ImportError:
return
raise unittest.SkipTest("Unable to import cv2.")
for img in TestImage.IMAGES:
with open(img, 'rb') as fp:
str_image = fp.read()
Expand All @@ -97,11 +97,12 @@ def test_scale_down(self):
assert mx.image.scale_down((360, 1000), (480, 500)) == (360, 375)
assert mx.image.scale_down((300, 400), (0, 0)) == (0, 0)

@with_seed()
def test_resize_short(self):
try:
import cv2
except ImportError:
return
raise unittest.SkipTest("Unable to import cv2")
for img in TestImage.IMAGES:
cv_img = cv2.imread(img)
mx_img = mx.nd.array(cv_img[:, :, (2, 1, 0)])
Expand All @@ -118,11 +119,12 @@ def test_resize_short(self):
mx_resized = mx.image.resize_short(mx_img, new_size, interp)
assert_almost_equal(mx_resized.asnumpy()[:, :, (2, 1, 0)], cv_resized, atol=3)

@with_seed()
def test_imresize(self):
try:
import cv2
except ImportError:
return
raise unittest.SkipTest("Unable to import cv2")
for img in TestImage.IMAGES:
cv_img = cv2.imread(img)
mx_img = mx.nd.array(cv_img[:, :, (2, 1, 0)])
Expand Down

0 comments on commit a35fcc4

Please sign in to comment.