Add BoundingBoxes class information
🚀 The feature
Another meta field which includes the index of the corresponding class of the BoudingBox.
Motivation, pitch
At the moment, I need to carry the class indices of the BoundingBoxes separate. This leads to the issue, that I need to carry it around everywhere I need to access the bbox.
Additional when creating a BBox the class creation method (init/new?) can guard against wrong shapes, if this optional feature is used.
Alternatives
No response
Additional context
No response
@NicolasHug I don't actually know who to ask, but what is the right approach to a bot implementation like the above?
Can you just pass tuples like (BoundingBox, class_index)? Or even a dict or anything. The index is an int and would be passed-through by the transforms (see also: https://pytorch.org/vision/stable/auto_examples/transforms/plot_transforms_getting_started.html#what-do-i-pass-as-input)
While this works and might be feasible for most projects, it makes it harder for other circumstances:
- Type Annotation and Checking
- Loose Bound of context between BBox and Index
I see why it might not be feasible to extend context for BBox, because of the different other possible context extensions, but what bothers me the process as a user, when I want to extend any Tensor based class.
Hmmm have you tried to create your own subclass of BoundingBoxes? You should be able to handle the label attribute the same way we handle the other attributes/metadata of BoundingBoxes
I've tried an approach with standard python inheritance.
I've looked inside BoundingBoxes and was wandering do I need to apply the hole wrapper configuration or is there a simpler way to extend the class?
I honestly don't know the answer to that from the top of my head, sorry. What I would try if I were you is to create a subclass of BoundingBoxes and copy/paste most of the overridden methods of BoundingBoxes in your subclass. And then take it from there, see what can be removed and what needs to stay.