[go: nahoru, domu]

Skip to content
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

Merged
merged 3 commits into from
Jun 27, 2024
Merged

Conversation

kirilman
Copy link

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.

  • New feature (non-breaking change which adds functionality)

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,
)

@CLAassistant
Copy link
CLAassistant commented Jun 21, 2024

CLA assistant check
All committers have signed the CLA.

@LinasKo
Copy link
Collaborator
LinasKo commented Jun 21, 2024

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>
@onuralpszr
Copy link
Collaborator

@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

Copy link
Collaborator
@LinasKo LinasKo left a 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.

@LinasKo
Copy link
Collaborator
LinasKo commented Jun 25, 2024

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!

@kirilman
Copy link
Author
kirilman commented Jun 26, 2024

@LinasKo 👋
Does Detectron 2 produce masks every time? Are there cases when no mask would be produced?

Yes, you're right. We need to think about the case of no mask

@onuralpszr
Copy link
Collaborator

@LinasKo 👋
Does Detectron 2 produce masks every time? Are there cases when no mask would be produced?

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 :)

@LinasKo
Copy link
Collaborator
LinasKo commented Jun 26, 2024

Indeed, the CLA allows us to include your code, @kirilman

@onuralpszr
Copy link
Collaborator

@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)

@onuralpszr onuralpszr merged commit d8f9902 into roboflow:develop Jun 27, 2024
9 checks passed
@onuralpszr
Copy link
Collaborator

@kirilman thank you for validation

@LinasKo merge complete :)

@LinasKo
Copy link
Collaborator
LinasKo commented Jun 27, 2024

Thank you @kirilman, @onuralpszr!

@onuralpszr
Copy link
Collaborator

Thank you @kirilman, @onuralpszr!

You're welcome, Pleasure ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants