-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
b9734a0
to
f3609a1
Compare
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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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.
e27b043
to
de41fe0
Compare
@srkreddy1238 have incorporated your comments, take a another look please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @yongwww . LGTM.
Add ResizeNearestNeighbor and CropAndResize. CropAndResize is a must for Mask-RCNN.