Skip to content

Commit

Permalink
incorporate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yongwww committed Dec 8, 2019
1 parent d3c4206 commit 02b36c1
Show file tree
Hide file tree
Showing 4 changed files with 498 additions and 272 deletions.
4 changes: 2 additions & 2 deletions python/tvm/relay/op/image/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def resize(data,
with data of shape (n, c, h, w)
out will have a shape (n, c, size[0], size[1])
method indicates the algorithm to be used while calculating ghe out value
method indicates the algorithm to be used while calculating the out value
and method can be one of ("bilinear", "nearest_neighbor", "bicubic")
Parameters
Expand Down Expand Up @@ -72,7 +72,7 @@ def crop_and_resize(data,
out_dtype=None):
"""Crop input images and resize them.
method indicates the algorithm to be used while calculating ghe out value
method indicates the algorithm to be used while calculating the out value
and method can be either "bilinear" or "nearest_neighbor".
Parameters
Expand Down
28 changes: 11 additions & 17 deletions tests/python/frontend/tensorflow/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,35 +1591,29 @@ def test_forward_crop_and_resize():
_test_forward_crop_and_resize([1, 6, 6, 3], [[0, 0, 1, 1]], [0], [3, 3])
_test_forward_crop_and_resize([1, 6, 6, 3], [[0, 0, 1, 1]], [0], [3, 3], 0.2)
_test_forward_crop_and_resize([1, 6, 6, 3], [[0, 0, 1, 1]], [0], [3, 3], 0.2, 'nearest')
_test_forward_crop_and_resize([1, 11, 11, 3], [[.3, .3, 1, 1]], [0], [21, 23])
_test_forward_crop_and_resize([1, 41, 41, 3], [[.2, .4, .8, .8]], [0], [50, 60])
_test_forward_crop_and_resize([1, 11, 11, 3], [[.3, .3, 1, 1]], [0], [21, 21])
_test_forward_crop_and_resize([1, 41, 41, 3], [[.2, .4, .8, .8]], [0], [21, 11])
_test_forward_crop_and_resize([1, 100, 100, 3], [[ 0, 0, .9, .9]], [0], [30, 30])
_test_forward_crop_and_resize([1, 224, 224, 3], [[.1, .2, 1, 1]], [0], [9, 9])
_test_forward_crop_and_resize([1, 250, 250, 3], [[.2, .2, .9, .8]], [0], [6, 7])
_test_forward_crop_and_resize([1, 200, 200, 3], [[.2, .3, .6, .8]], [0], [100, 150])
_test_forward_crop_and_resize([1, 249, 249, 3], [[ 0, 0, 1, 1]], [0], [9, 9])
_test_forward_crop_and_resize([1, 201, 301, 3], [[.2, .3, .7, .8]], [0], [51, 51])
_test_forward_crop_and_resize(img_shape=[10, 11, 11, 3],
boxes=[[ 0, 0, .9, .9],
[.2, .2, .8, .8]],
box_idx=[0, 1], crop_size=[5, 5])
_test_forward_crop_and_resize(img_shape=[20, 229, 229, 3],
boxes=[[ 0, 0, .9, .9],
[.3, .3, 1, 1],
[.2, .1, .7, .8],
[ 0, 0, 1, 1]],
box_idx=[0, 1, 2, 3], crop_size=[60, 90])
_test_forward_crop_and_resize(img_shape=[20, 229, 229, 3],
boxes=[[ 0, 0, .9, .9],
[.3, .3, 1, 1],
[.2, .1, .7, .8],
[ 0, 0, 1, 1]],
box_idx=[3, 0, 2, 1], crop_size=[60, 90],
_test_forward_crop_and_resize(img_shape=[20, 576, 576, 3],
boxes=[[ 0, 0, 1, 1],
[ 0, 0, .8, .8],
[.1, .2, .9, 1],
[.2, 0, 1, 1]],
box_idx=[1, 0, 2, 3], crop_size=[24, 24],
extrapolation_value=0.3)
_test_forward_crop_and_resize(img_shape=[20, 229, 229, 3],
boxes=[[ 0, 0, .9, .9],
[.3, .3, 1, 1],
[.2, .1, .7, .8],
[ 0, 0, 1, 1]],
box_idx=[3, 0, 2, 1], crop_size=[60, 90],
box_idx=[3, 0, 2, 1], crop_size=[58, 58],
extrapolation_value=0.2, method='nearest')


Expand Down
Loading

0 comments on commit 02b36c1

Please sign in to comment.