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

Restructure; Add Parsers, Util Functions and Message Creators #4

Merged
merged 42 commits into from
Jun 24, 2024

Conversation

jkbmrz
Copy link
Collaborator

@jkbmrz jkbmrz commented Jun 6, 2024

Adding the following utils functions:

  • decode_detections: Decode the detections from neural network output tensors,
  • unnormalize_image: Un-normalize an image tensor by scaling it to the [0, 255] range,
  • create_detections_msg: Create a depthai message for an image array,
  • create_image_msg: Create a depthai message for an image array,
  • create_monocular_depth_msg: Creates a depth message in the form of an ImgFrame using the provided depth map and depth type,
    and adjusting the existing postprocessing nodes to these changes.

@kkeroo, some things to consider:

  • could you please adjust + test your postprocessing nodes to the new utils functions
  • I've added create_monocular_depth_msg despite you already have implemented something similar in create_depth_segmentation_msg. However, I think its better we keep the two tasks (segmentation and depth estimation) separated. EDIT: I see this was changed in the meantime and segmentation and depth are already separated. Will check how I can merge my code

@tersekmatija, could you please check the create_monocular_depth_msg function to confirm it's implemented as expected?

@jkbmrz jkbmrz requested review from tersekmatija and kkeroo June 6, 2024 11:55
@jkbmrz jkbmrz changed the title Add Postprocessing and Message-Generation Utils Add Util Functions Jun 6, 2024

class YuNetParser(dai.node.ThreadedHostNode):
def __init__(
self,
score_threshold=0.6,
nms_threshold=0.3,
top_k=5000,
input_size=(640, 640), # WH
input_size=(640, 640), # WH

Choose a reason for hiding this comment

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

Is this required? We seem to use it for cols and rows calculation, which we can simply get from the output shape of the tensor itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added in 92f2ea4. However, this automatic detection doesn't work non-square inputs as pointed out here.

@kkeroo
Copy link
Collaborator

kkeroo commented Jun 7, 2024

  • could you please adjust + test your postprocessing nodes to the new utils functions

I will test utils functions.

  • I've added create_monocular_depth_msg despite you already have implemented something similar in create_depth_segmentation_msg. However, I think its better we keep the two tasks (segmentation and depth estimation) separated. EDIT: I see this was changed in the meantime and segmentation and depth are already separated. Will check how I can merge my code

Yea, probably we can delete create_depth_message() as you have your depth function, and we can leave create_segmentation_message as is.

@jkbmrz
Copy link
Collaborator Author

jkbmrz commented Jun 19, 2024

Yea, probably we can delete create_depth_message() as you have your depth function, and we can leave create_segmentation_message as is.

In 17ce753, I've merged the old depth message to monocular_depth message and deleted it. @kkeroo, can you check and confirm this is OK? EDIT: It's now called depth message.

@jkbmrz jkbmrz requested review from tersekmatija and kkeroo June 19, 2024 15:00
@jkbmrz jkbmrz requested a review from tersekmatija June 20, 2024 08:56
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.

The new depth message looks good. I tested new util functions and they work.

@kkeroo kkeroo mentioned this pull request Jun 21, 2024
Copy link

@tersekmatija tersekmatija left a comment

Choose a reason for hiding this comment

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

Please address the one comment, then merge and we can update #5 to use this.

@jkbmrz jkbmrz changed the title Add Util Functions Restructure; Add Parsers, Util Functions and Message Creators Jun 24, 2024
@jkbmrz jkbmrz merged commit 83b51c2 into main Jun 24, 2024
@jkbmrz jkbmrz deleted the feature/add_node_utils branch June 24, 2024 13:09
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.

3 participants