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

fix: image creator function #188

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

fix: image creator function #188

wants to merge 3 commits into from

Conversation

jkbmrz
Copy link
Collaborator

@jkbmrz jkbmrz commented Mar 14, 2025

Purpose

Outputs of the ImageOutputParser are not visualized correctly in DAI Visualizer due to a bug in the create_image_message() creator.

Specification

Changes in create_image_message():

  • Use .setCvFrame() instead of .setData() when creating the dai.ImgFrame,
  • add an argument (img_frame_type) to adjust the output ImgFrame.Type to the running platform.

Changes in ImageOutputParser:

  • extract running platform and pass the correct ImgFrame.Type when calling the create_image_message().

Dependencies & Potential Impact

None

Deployment Plan

None

Testing & Validation

The changes were tested by running the generic-example both on RVC2 and RVC4 for the following models:

  • rt-super-resolution
  • esrgan (RVC4 only)
  • zero-dce

@github-actions github-actions bot added the fix Fixing a bug label Mar 14, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 14, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 47.50%. Comparing base (69ffd94) to head (7f8a292).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
depthai_nodes/node/parsers/image_output.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #188      +/-   ##
==========================================
+ Coverage   41.63%   47.50%   +5.86%     
==========================================
  Files          75       75              
  Lines        4285     4286       +1     
==========================================
+ Hits         1784     2036     +252     
+ Misses       2501     2250     -251     

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

@jkbmrz
Copy link
Collaborator Author

jkbmrz commented Mar 14, 2025

To discuss: ImageOutputParser currently always ouputs dai.ImgFrame of type BGR888i. This works for the simple visualizations (e.g. generic-example) but might we want to adjust it to the device the pipeline is running on (e.g. if input to the model is BGR888p, that the parser also outputs BGR888p instead of BGR888i as is the case now)?

@kkeroo
Copy link
Collaborator

kkeroo commented Mar 17, 2025

but might we want to adjust it to the device the pipeline is running on

We can since it is probably easy addition (self.getParentPipeline()...). But the change will probably be useful only if we send the message to the new NN node because in the visualization you can get the frame out with getCvFrame()

jkbmrz and others added 2 commits March 19, 2025 12:50
* Bug fix.

* Bug fix.

* Move.

* Unittest for Tiling and TilesPatcher.

* Add stability tests for host nodes.

* Improve readability.

* Renaming to stability tests.
@github-actions github-actions bot added the tests Changes affecting tests label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Fixing a bug tests Changes affecting tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants