Skip to content

Conversation

@aljazkonec1
Copy link
Contributor

Purpose

This PR adds host side implementation of the updated Detection parser. This is necessary for parsing Segmentation head outputs when using RVC2 due to high computational cost.

Specification

None / not applicable

Dependencies & Potential Impact

None / not applicable

Deployment Plan

None / not applicable

Testing & Validation

The detection_parser_test label expanded with onhost label. Tests passed.

Base automatically changed from dev_update_detection_parser to develop November 14, 2025 14:13
@aljazkonec1 aljazkonec1 added the testable PR is ready to be tested label Nov 17, 2025
@aljazkonec1 aljazkonec1 marked this pull request as ready for review November 17, 2025 15:29
@aljazkonec1 aljazkonec1 requested a review from moratom November 18, 2025 07:39
Copy link
Collaborator

@moratom moratom left a comment

Choose a reason for hiding this comment

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

LGTM if tests pass

@aljazkonec1 aljazkonec1 removed the testable PR is ready to be tested label Nov 18, 2025
@aljazkonec1 aljazkonec1 requested a review from Copilot November 18, 2025 14:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds host-side implementation for the Detection parser to handle parsing of Segmentation head outputs on RVC2 devices where on-device processing is computationally expensive. The implementation introduces utilities for tensor data access and YOLO decoding algorithms (v3, v5, v6, v8, etc.) that can run on the host instead of the device.

Key changes:

  • Added NNDataViewer utility class for safe tensor data access across different storage orders and data types
  • Implemented multiple YOLO decoding families (R1AF, v3AB, v5AB, TLBR) with support for segmentation and keypoint decoding
  • Extended DetectionParser node to support host-side execution via setRunOnHost() API

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/CMakeLists.txt Expanded test labels to include ondevice and platform-specific tags
src/pipeline/utilities/NNDataViewer.hpp New utility class for accessing tensor data with different storage orders and data types
src/pipeline/utilities/DetectionParser/DetectionParserUtils.hpp Header declaring detection parsing utility functions for various YOLO families
src/pipeline/utilities/DetectionParser/DetectionParserUtils.cpp Implementation of YOLO decoding algorithms, NMS, and segmentation/keypoint processing
src/pipeline/node/DetectionParser.cpp Added host-side run loop and decoder dispatch logic
src/pipeline/datatype/ImgDetectionsT.cpp Added type validation for segmentation mask input
include/depthai/pipeline/node/DetectionParser.hpp Extended node interface to support host execution mode
include/depthai/pipeline/datatype/ImgDetectionsT.hpp Updated documentation for setCvSegmentationMask
examples/python/DetectionNetwork/detection_and_segmentation.py Updated example to conditionally enable host parsing on RVC2
examples/python/DetectionNetwork/detection_and_keypoints.py Updated model references and camera settings
examples/cpp/DetectionNetwork/detection_and_segmentation.cpp Updated C++ example with RVC2 detection and model selection
examples/cpp/DetectionNetwork/detection_and_keypoints.cpp Updated model reference to nano variant
examples/cpp/DetectionNetwork/CMakeLists.txt Fixed example file paths
cmake/Depthai/DepthaiDeviceSideConfig.cmake Updated device-side binary commit hash
bindings/python/src/pipeline/node/DetectionParserBindings.cpp Added Python bindings for setRunOnHost/runOnHost methods
CMakeLists.txt Added DetectionParserUtils.cpp to build sources
Comments suppressed due to low confidence (1)

src/pipeline/node/DetectionParser.cpp:1

  • Variable imgSizesSet should be of type bool instead of uint32_t since it stores a boolean state. The current type is misleading.
#include "depthai/pipeline/node/DetectionParser.hpp"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aljazkonec1 aljazkonec1 added the testable PR is ready to be tested label Nov 19, 2025
@aljazkonec1 aljazkonec1 removed the testable PR is ready to be tested label Nov 21, 2025
@aljazkonec1 aljazkonec1 added the testable PR is ready to be tested label Nov 21, 2025
@aljazkonec1 aljazkonec1 merged commit a05a2a6 into develop Nov 21, 2025
51 of 54 checks passed
@aljazkonec1 aljazkonec1 deleted the dev/update_rvc2_detection_parser branch November 21, 2025 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testable PR is ready to be tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants