Skip to content

Conversation

@brianzheng206
Copy link

@brianzheng206 brianzheng206 commented Jan 1, 2026

  • refactored deep_object_detection to work with any ONNX detection model (YOLO, DINO, Faster R-CNN, DETR, etc.)
  • implemented a generic postprocessor automatically detects and adapts to model output format
  • added configuratble pre-processing; multiple normalization schemes, resize methods (letterbox/resize/crop/pad), and RGB/BGR conversion

things that are supported:

  • 3 channels, RGB/BGR only (no grayscale/multispectral)
  • image data type is float32 only
  • batch dimensions assumed to be dimension 0: [batch, channels=3, height, width] input and [batch, detections, features] output
  • the auto-detect layout uses dim <= 8 heuristic (may fail on ambiguous shapes)
  • batch size limit max 16

tested with yolov8m.onnx and camera_sync, publishing at ~30hz with tensorrt ep

Copy link
Contributor

@Edwardius Edwardius left a comment

Choose a reason for hiding this comment

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

Good work! Some comments to address, most of which should remove more code than it adds.

I'm seeing a number of recovery mechanisms that I'm not fond of. Silently failing is very dangerous, and stops developers and users from making sure that the code is running exactly as they want it to.

if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/test_postprocessors.cpp)
ament_add_gtest(test_postprocessors test/test_postprocessors.cpp)
Copy link
Contributor

Choose a reason for hiding this comment

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

these should be using deep_test library

Comment on lines 81 to 111
#### Step 1: Launch Camera Sync Node

First, launch the camera sync node to synchronize your camera feeds:

```bash
ros2 launch camera_sync multi_camera_sync.launch.yaml
```

Or with custom configuration using a parameter file:

Create a config file `camera_sync_config.yaml`:
```yaml
multi_camera_sync:
ros__parameters:
camera_topics:
- "/CAM_FRONT/image_rect_compressed"
- "/CAM_FRONT_LEFT/image_rect_compressed"
- "/CAM_FRONT_RIGHT/image_rect_compressed"
use_compressed: true
sync_tolerance_ms: 33.0
```
Then launch with:
```bash
ros2 launch camera_sync multi_camera_sync.launch.yaml \
--ros-args --params-file camera_sync_config.yaml
```

Alternatively, modify the default config file at:
`$(find-pkg-share camera_sync)/config/multi_camera_sync_params.yaml`

Copy link
Contributor

Choose a reason for hiding this comment

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

multi_camera_sync and this node should be able to be added into a single component container to allow for zero copy message passing. If that already works, maybe make note of it here?

description="Detections output topic override",
)
provider_arg = DeclareLaunchArgument(
"preferred_provider",
Copy link
Contributor

Choose a reason for hiding this comment

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

provider should be explicit, if one fails, the node should just fail, no fall back needed

Comment on lines 100 to 102
if (!executor_) {
throw std::runtime_error("No backend initialized; dropping batch");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

if no backend is initialized, node should just fail to initialize no?

Copy link
Contributor

Choose a reason for hiding this comment

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

i have a hunch that this code is the result of a badly designed execution provider backend plugin that I made. Please check if this code should actually just be part of the backend execution plugin (also deep_object_detection should not have any onnx-specific implementation details in it, it should agnostic to the backend it uses.)

Copy link
Contributor

Choose a reason for hiding this comment

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

question you should be asking is: if i changed the backend plugin i used, would this node still run?

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.

4 participants