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 dai.ImgTransformations to messages and improvements to Text detection parser #142

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

aljazkonec1
Copy link
Contributor

This PR adds the following:

  1. dai.ImgTransformations attribute to all depthai-nodes messages. This is necessary as the information inside dai.ImgTransofrmations is needed in later nodes for dai.ImgManip, and for visualization purposes as width, height and other values are stored in this attribute.
  2. adds some improvements to Text Detection parser and Palm detection parser where the angle is rounded to a full degree.
  3. Make Text detection parser more robust and simplify some postprocessing functions, making the detections much more reliable

@github-actions github-actions bot added messages Changes affecting ml.messages parsers Changes affecting ml.parsers labels Nov 28, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2024

Codecov Report

Attention: Patch coverage is 37.73585% with 66 lines in your changes missing coverage. Please review.

Project coverage is 33.38%. Comparing base (37a2d92) to head (23e6c55).
Report is 14 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
depthai_nodes/ml/parsers/utils/ppdet.py 0.00% 8 Missing ⚠️
depthai_nodes/ml/messages/classification.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/clusters.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/img_detections.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/keypoints.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/lines.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/map.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/prediction.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/messages/segmentation.py 55.55% 4 Missing ⚠️
depthai_nodes/ml/parsers/lane_detection.py 0.00% 4 Missing ⚠️
... and 16 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
- Coverage   33.40%   33.38%   -0.02%     
==========================================
  Files          68       69       +1     
  Lines        3739     3828      +89     
==========================================
+ Hits         1249     1278      +29     
- Misses       2490     2550      +60     

☔ 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.

LGTM

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.

Added a small remark but LGTM otherwise!


@property
def transformation(self) -> dai.ImgTransformation:
"""Returns the Image Transformation object.
Copy link
Collaborator

Choose a reason for hiding this comment

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

As the transformation property and setter are the same for every message, we could also make a message parent class that would define them once instead of copy-pasting them to all messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I also thought about it. I asked depthai team and when this will get ported, all messages will inherit from dai.Buffer and will have similar structure as dai.ImgDetections currently has. Thats why I left it as is.

@aljazkonec1 aljazkonec1 merged commit dc06a58 into main Nov 29, 2024
10 checks passed
@aljazkonec1 aljazkonec1 deleted the change-messages-to-nndata branch November 29, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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