Skip to content

Added the flag draw_scores to the function draw_boxes. #219

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

Merged
merged 2 commits into from
Dec 1, 2022
Merged

Added the flag draw_scores to the function draw_boxes. #219

merged 2 commits into from
Dec 1, 2022

Conversation

moooises
Copy link
Contributor

The flag draw_scores in the function draw_boxes add the score detection of each detected object to a tittle that is drawn on top of the box. Its color and size are the same as the label and the id.

…ore of the class to the tittle on top of the box with the label and id .
Copy link
Collaborator

@javiber javiber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @moooises, just requested a few small changes.

In addition to that, can we add the same option draw_scores to the draw_poinst function? it should behave just like this one.

Again, thank you for the contribution and let me know about if you have any question

@@ -182,6 +187,7 @@ def draw_tracked_boxes(
draw_box: bool = True,
color_by_label: bool = False,
draw_labels: bool = False,
draw_scores: bool = False,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add this parameter here, this function is deprecated and is just here for backward compatibility

if draw_scores and drawable.scores is not None:
if len(text) > 0:
text += "-"
text += str(np.round(drawable.scores[0],4))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For bounding boxes, all scores are the same but for keypoints this might not be the case, for this reason, I think is better to draw the average of all scores instead of the first one

@moooises
Copy link
Contributor Author

Ok, I will do it tomorrow.

Copy link
Collaborator

@javiber javiber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks @moooises for the quick adjustments. I will test it again and merge it later today

@javiber javiber merged commit a4891a0 into tryolabs:master Dec 1, 2022
@moooises moooises deleted the draw_score branch December 1, 2022 21:01
@facundo-lezama facundo-lezama linked an issue Dec 5, 2022 that may be closed by this pull request
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.

Draw scores in Detection boxes
2 participants