Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Relay][TensorFlow] Add ResizeNearestNeighbor and CropAndResize in tf converter #3393

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

yongwww
Copy link
Member

@yongwww yongwww commented Jun 18, 2019

Add ResizeNearestNeighbor and CropAndResize. CropAndResize is a must for Mask-RCNN.

@yongwww
Copy link
Member Author

yongwww commented Jun 18, 2019

@srkreddy1238 @zhiics @tqchen

@yongwww yongwww force-pushed the crop_resize branch 2 times, most recently from b9734a0 to f3609a1 Compare June 18, 2019 23:22
def _impl(inputs, attr, params):
# input image is a 4-D tensor of shape [batch, image_height, image_width, depth]
# boxes is a 2-D tensor of shape [num_boxes, 4], 4 is for [y1, x1, y2, x2]
boxes = params.pop(inputs[1].name_hint).asnumpy()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if we have to infer it by any chance if not available in params ?

crop_size = params.pop(inputs[3].name_hint).asnumpy().tolist()
method = attr['method'].decode()

# 1) Crop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why boxes at 0 handled differently ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handled all boxes in a loop now.

_test_forward_crop_and_resize([3, 11, 11, 3],
[[0, 0, 0.9, 0.9], [0.2, 0.2, 0.8, 0.8], [0, 0, 1, 1]],
[0, 1, 2], [3, 3])
_test_forward_crop_and_resize([1, 16, 16, 3], [[0.2, 0.4, 0.8, 0.8]], [0], [3, 3])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test case by shuffling the box indicator.

@yongwww yongwww force-pushed the crop_resize branch 2 times, most recently from e27b043 to de41fe0 Compare June 24, 2019 23:34
@yongwww
Copy link
Member Author

yongwww commented Jun 24, 2019

@srkreddy1238 have incorporated your comments, take a another look please

Copy link
Contributor

@srkreddy1238 srkreddy1238 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yongwww . LGTM.

@srkreddy1238 srkreddy1238 merged commit cbec5b9 into apache:master Jun 25, 2019
@srkreddy1238
Copy link
Contributor

Thanks @zhiics & @yongwww . This is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants