You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the bounding box operators (tf.image.draw_bounding_boxes, tf.image.non_max_suppression and tf.image.sample_distorted_bounding_box) expect bounding boxes in the form of [ymin, xmin, ymax, xmax], with the origin (0,0) being the lower left corner of the image. But images themselves are tensors, and the pixel with index [0,0] in the tensor is in the top left, so bounding box coordinates are the opposite in the y direction to tensor indices.
Additionally, the operations tf.image.pad_to_bounding_box and tf.image.crop_to_bounding_box take coordinates in the form of [ymin, xmin, height, width], with the origin being the top-left corner, so the coordinates are inconsistent even within the image ops themselves (plus the parametrization of the bounding boxes is different, too).
And the tf.image.crop_and_resize op doesn't specify what origin it uses (though I think it's bottom left too)
I feel like this sort of inconsistency is unnecessarily confusing and a high risk for introducing errors.
It's especially bad since, if you supply bounding boxes the wrong way around to draw_bounding_boxes, it'll still draw them correctly (
All bounding box operators should use the same coordinate system and preferably the same parametrization, and preferably the coordinates should be consistent with image tensor indexing.
Reacted by Tim Zaman, Stargazer and Dig Vijay Kumar Yarlagadda
I think this is a great proposal. It would be great to aim for a consistent API with regard to bounding box coordinates. I suspect that the default origin of top-left corner would make sense but I am open to suggestions.
If we do agree upon this then, we would need to update the API for tf.image.draw_bounding_boxes, tf.image.non_max_suppression and tf.image.sample_distorted_bounding_box in a manner that avoids (silently) breaking all users.
Activity
asimshankar commentedon Apr 11, 2017
@shlens : Do you have any thoughts about this?
shlens commentedon Apr 11, 2017
I think this is a great proposal. It would be great to aim for a consistent API with regard to bounding box coordinates. I suspect that the default origin of top-left corner would make sense but I am open to suggestions.
If we do agree upon this then, we would need to update the API for
tf.image.draw_bounding_boxes,tf.image.non_max_suppressionandtf.image.sample_distorted_bounding_boxin a manner that avoids (silently) breaking all users.tensorflowbutler commentedon Dec 22, 2017
It has been 14 days with no activity and the
awaiting tensorflowerlabel was assigned. Please update the label and/or status accordingly.tensorflowbutler commentedon Jan 6, 2018
Nagging Assigneee: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.
asimshankar commentedon Jan 8, 2018
Marking this as "Contributions Welcome" in case someone wants to pick this up (and any API changes can be reviewed in the pull request). Thanks.
github-actions commentedon Mar 28, 2023
This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you.
github-actions commentedon Mar 29, 2024
This issue was closed because it has been inactive for 1 year.
google-ml-butler commentedon Mar 29, 2024
Are you satisfied with the resolution of your issue?
Yes
No