-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Fix post process function called in the instance segmentation example of mask2former #34588
Conversation
This looks like a good fix to me, but cc @NielsRogge to confirm! |
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.
Thanks for fixing! cc @qubvel
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.
Thank you!
@@ -2416,7 +2416,7 @@ def forward( | |||
>>> masks_queries_logits = outputs.masks_queries_logits | |||
|
|||
>>> # Perform post-processing to get instance segmentation map | |||
>>> pred_instance_map = image_processor.post_process_semantic_segmentation( | |||
>>> pred_instance_map = image_processor.post_process_instance_segmentation( | |||
... outputs, target_sizes=[image.size[::-1]] |
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.
It would be also nice to include:
... outputs, target_sizes=[image.size[::-1]] | |
... outputs, target_sizes=[(image.height, image.width)] |
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.
Should we change this line in the examples for all three segmentation tasks?
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.
Yeah, sure!
…tation of maskformers
I just made another change to the doc of post_process_instance_segmentation of both maskformer and mask2former image processors. I added this line, as current default behavior of the method will not deal with the cases where instances could overlap, but the descriptions related to
Additionally, I changed this line to make it more precise for the description of the returned result covering the case where
|
the pr now has included above mentioned changes on doc. |
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.
🤗 thanks
… of mask2former (huggingface#34588) * Fix post process function called in the instance segmentation example of mask2former * fix description and additional notes for post_process_instance_segmentation of maskformers * remove white space in maskformers post_process_instance_segmentation doc * change image.size[::-1] to height and width for clarity in segmentation examples
… of mask2former (huggingface#34588) * Fix post process function called in the instance segmentation example of mask2former * fix description and additional notes for post_process_instance_segmentation of maskformers * remove white space in maskformers post_process_instance_segmentation doc * change image.size[::-1] to height and width for clarity in segmentation examples
What does this PR do?
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.