-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Add fill parameter to utils.draw_bounding_boxes. #3280
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
Comments
I like the idea of filling the box with colour but do you think it's necessary to use the a different colour than the border? Perhas that can be reused and instead turn fill to a boolean? What do you think? |
It could be fine with boolean too. I'm not sure if the above is really valid use case. One such example is here. Code to reproduce results
Let me know I can send PR for either. Only caveat is since we are drawing semi transparent color mask using Alpha channel (4 channel image) I think we can leave the option open to user? IMO We can easily keep flexibility |
@oke-aditya Awesome, let's continue the discussion on the PR. |
🚀 Feature
Fill parameter allows creating a semi-transparent box. This is particularly useful for Mask RCNN Model.
This would complete utils for Object detection and Instance Segmentation (least with rectangular boxes)
Motivation
In Instance segmentation models, we also care about masks, not just the bounding box. Fill parameter allows us to fill in a semi-transparent way. Also, this parameter is optional hence it does not affect performance.
Pitch
Add a param fill as follows
Here is complete running code with a few edits
This makes mask RCNN output more clear, and people can play with fill parameter such as confidence based fill, fill with colors different per class, etc.
Additional context
I can send PR for this 😅 I'm attaching outputs of above code.
(Sorry PyTorch logo 🙏 )
The text was updated successfully, but these errors were encountered: