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

Add visualization methods to all message types #141

Merged
merged 23 commits into from
Dec 10, 2024

Conversation

aljazkonec1
Copy link
Contributor

@aljazkonec1 aljazkonec1 commented Nov 26, 2024

This PR adds default getVisualizationMessage methods to all messages. These methods allow depthai to automatically annotate outputs of all models that use these message types. This is the "default" visualizations, if a user wants custom or different annotations, he would have to override these functions or create a new AnnotationNode.

The annotations were tested using RVC4 and RVC2 (where aplicable) on the following models:
YuNet, YOLOv6, YOLOv8, text detection, M-LSD, Fast SAM, Selfie segmentation, PP-LiteSeg, FaceLandmarker, OCR, Emotion classification, Depthanything, Midas, ESRGAN, Ultra Fast Lane Detection

@github-actions github-actions bot added enhancement New feature or request messages Changes affecting ml.messages labels Nov 26, 2024
@aljazkonec1
Copy link
Contributor Author

In Keypoints message there is a bug with Visualizer, where it does not show points, for the time being I changed to lines instead.

@codecov-commenter
Copy link

codecov-commenter commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 15.68627% with 129 lines in your changes missing coverage. Please review.

Project coverage is 36.10%. Comparing base (f11ad94) to head (3f4ff72).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
depthai_nodes/ml/messages/img_detections.py 7.50% 37 Missing ⚠️
depthai_nodes/ml/messages/clusters.py 16.66% 20 Missing ⚠️
depthai_nodes/ml/messages/segmentation.py 12.50% 14 Missing ⚠️
depthai_nodes/ml/messages/classification.py 13.33% 13 Missing ⚠️
depthai_nodes/ml/messages/keypoints.py 13.33% 13 Missing ⚠️
depthai_nodes/ml/messages/prediction.py 13.33% 13 Missing ⚠️
depthai_nodes/ml/messages/lines.py 14.28% 12 Missing ⚠️
depthai_nodes/ml/messages/map.py 22.22% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #141      +/-   ##
==========================================
+ Coverage   35.93%   36.10%   +0.17%     
==========================================
  Files          69       70       +1     
  Lines        3835     3991     +156     
==========================================
+ Hits         1378     1441      +63     
- Misses       2457     2550      +93     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

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

Generally LGTM, added some clarifying questions.

depthai_nodes/ml/messages/creators/image.py Outdated Show resolved Hide resolved
depthai_nodes/ml/messages/img_detections.py Show resolved Hide resolved
Copy link
Collaborator

@jkbmrz jkbmrz left a comment

Choose a reason for hiding this comment

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

Generally LGTM. Adding a few comments.

depthai_nodes/ml/messages/classification.py Outdated Show resolved Hide resolved
depthai_nodes/ml/messages/map.py Show resolved Hide resolved
depthai_nodes/ml/messages/segmentation.py Show resolved Hide resolved
depthai_nodes/ml/messages/segmentation.py Show resolved Hide resolved
Copy link
Collaborator

@kkeroo kkeroo left a comment

Choose a reason for hiding this comment

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

LGTM, 2 small comments/questions

depthai_nodes/ml/messages/classification.py Outdated Show resolved Hide resolved
depthai_nodes/ml/messages/img_detections.py Outdated Show resolved Hide resolved
@github-actions github-actions bot added the parsers Changes affecting ml.parsers label Nov 28, 2024
@aljazkonec1 aljazkonec1 merged commit 200bf4f into main Dec 10, 2024
10 of 11 checks passed
@aljazkonec1 aljazkonec1 deleted the feat/detection_visualization_node branch December 10, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request messages Changes affecting ml.messages parsers Changes affecting ml.parsers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants