A couple of questions about bbox module functions
See original GitHub issueHi guys,
during the bbox
module refactoring, I have encountered a couple of weird things and I wanted to make sure that everything is how it suppose to be:
- bbox width and height arithmetic seem to be inclusive (adding +1 to the difference of coordinates): https://github.com/kornia/kornia/blob/1e0ccad60611f5e47d4eddbf950f120c30020dd9/kornia/geometry/bbox.py#L105-L107 So when we have this example: https://github.com/kornia/kornia/blob/1e0ccad60611f5e47d4eddbf950f120c30020dd9/kornia/geometry/bbox.py#L90-L95 the width and height is 2 pixels: https://github.com/kornia/kornia/blob/1e0ccad60611f5e47d4eddbf950f120c30020dd9/kornia/geometry/bbox.py#L102 Is it a standard procedure? It is the first time I see something like this - examples of other works for both 2D and 3D that are taking just a plain arithmetic difference without adding 1 to it. Two examples: EfficientDet in 2D: https://github.com/xuannianz/EfficientDet/blob/030fb7e10ab69a297c7723120c2d1be856a852c0/generators/coco.py#L152 and OpenPCDet in 3D: https://github.com/open-mmlab/OpenPCDet/blob/26a16123cf820e29ed565f4ad53964c66f3ea030/pcdet/utils/box_utils.py#L28
- The convention of coordinates used in the bbox module assumes the order
x, y, z
, but the return values ininfer_bbox_shape
are reversed:height, width
in 2D anddepth, height, width
in 3D. Is there any particular reason why the order is reversed? https://github.com/kornia/kornia/blob/1e0ccad60611f5e47d4eddbf950f120c30020dd9/kornia/geometry/bbox.py#L105-L107 bbox_to_mask
andbbox_to_mask3d
have inconsistent arguments:bbox_to_mask(boxes: torch.Tensor, width: int, height: int)
andbbox_to_mask3d(boxes: torch.Tensor, size: Tuple[int, int, int])
accordingly. Can I make them more consistent? For example:bbox_to_mask(boxes: torch.Tensor, size: Tuple[int, int])
andbbox_to_mask3d(boxes: torch.Tensor, size: Tuple[int, int, int])
?
I have analyzed the commit history and I believe @shijianjian wrote most of the bbox
functionalities. @shijianjian , can you take a look at the points above and let me your thoughts?
Issue Analytics
- State:
- Created 2 years ago
- Comments:53 (38 by maintainers)
Top Results From Across the Web
Arguments of bbox_to_anchor() function - Stack Overflow
In the above code I have come accross the function bbox_to_anchor which places the legend in arbitary postion . I am not able...
Read more >Introduction to {box} (1)
Goal of this talk. Introduce the {box} package and show how it can be used to write modularized/organized code and manage the name...
Read more >The Shapely User Manual — Shapely 2.0.0 documentation
Shapely is a Python package for set-theoretic analysis and manipulation of planar features using (via Python's ctypes module) functions from the well known ......
Read more >End-to-End Google Earth Engine (Full Course Material)
We use filters to select the appropriate images. There are many types of filter functions, look at ee.Filter... module to see all available...
Read more >Victron & BYD - Battery Compatibility
In off-grid systems, the control functions of the BYD Battery Management ... Each B-Box Pro 2.5 battery module is approximately 50Ah at 48V ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @hal-314 for letting us know about the Detectron2 convention, we will probably adapt it to Kornia. I think I can now start working on the first work in progress version for the updated bbox module. I will keep you posted @shijianjian 🚀
Hi @dkoguciuk,
(x, y, h, w)
,(x, y, x, y)
, I think this inclusion can be more intuitive as we actually expect the point to be included while write it. Since our bbox format is a bit irregular due to the need bygrid_sample
, I think what we need is the good conversion from formats like(x, y, h, w)
,(x, y, x, y)
to corner bbox.BCHW
andBCDHW
.Plus, for bbox module, I think we are now in a good condition for handling most common cases. I would propose to go further down to other modalities like the rotated bbox 2d and 3d as mentioned in slack. Also, some bbox computations like this to attrack more advanced users. Please take these random ideas into consideration. 😃