-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Faster implementation of torchvision.ops.boxes::masks_to_boxes #8184
Description
🚀 The feature
torchvision.ops.boxes::masks_to_boxes is used to convert a batch of binary 2D image masks to a set of bounding boxes. This proposal pertains to creating a faster and more general version of this function.
Motivation, pitch
The implementation of masks_to_boxes utilizes a for loop over the batch dimension to individually compute the bounding box for each mask, giving the function an
Some primitive performance benchmarking seems to validate this hypothesis.
The proposed version is also more general, as it can be extended to 3D masks easily.
Alternatives
N/A
Additional context
I've already implemented this feature and have a pull request ready. However, I wish to understand if the core contributors believe this is a worthwhile feature or not.
### Tasks
