-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
detectron2 mask convert to detection #1300
Conversation
Hi @kirilman 👋 Does Detectron 2 produce masks every time? Are there cases when no mask would be produced? |
…tron2 Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
@LinasKo Test collab with results https://colab.research.google.com/drive/1ich6f2UBOYXAV4AuKRt2mDi4trzXfs0w?usp=sharing With and without mask result and original vis result, If all good I am merging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation looked peculiar, but it seems the pre-commit formats it this way.
Hi @kirilman 👋 This is a great contribution, and together with @onuralpszr's change, we'd really like to use it in our repository! However, before we do, you need to sign the Contributor License Agreement. Can you please follow the link and complete it? Thank you! |
Yes, you're right. We need to think about the case of no mask |
I already cover that part in your PR branch could you please accept CLA so we can merge :) |
Indeed, the CLA allows us to include your code, @kirilman |
@kirilman I notice that you made commit with an e-mail didn't register to github so you might want to add your e-mail you used to commit to here to your github account ( I assume e-mail is valid) |
Thank you @kirilman, @onuralpszr! |
You're welcome, Pleasure ❤️ |
Description
Copying segmentation masks from detectron2 predictions to the detection class. The resulting masks can be used for displaying with sv.MaskAnnotator().
Type of change
Please delete options that are not relevant.
How has this change been tested, please provide a testcase or example of how you tested the change?
The code is executed:
detections = sv.Detections.from_detectron2(p_det)
bounding_box_annotator = sv.MaskAnnotator()
annotated_frame = bounding_box_annotator.annotate(
scene=img.copy(),
detections=detections,
)