Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docker-ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
rmw-implementation: rmw_zenoh_cpp
command: ros2 launch image_instance_segmentation image_instance_segmentation.launch.py
enable-recursive-vcs-import: "false"
enable-build-required-packages-only: "true"
enable-industrial-ci: true
enable-slim: "true"
# Retain optional runtime binaries and plugin dependencies.
Expand All @@ -51,6 +52,7 @@ jobs:
--target-compose-svc image-instance-segmentation
--dep-exclude-compose-svc-all
--include-bin /opt/tritonclient/lib/libgrpcclient.so
--include-path /docker-ros/ws/install/perception_msgs
--include-bin /opt/ros/jazzy/lib/libcompressed_image_transport.so
--include-bin /opt/ros/jazzy/lib/librcl_interfaces__rosidl_generator_py.so
--include-exe lttng
Expand Down
4 changes: 4 additions & 0 deletions .repos
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ repositories:
type: git
url: https://github.com/openads-project/triton_cpp.git
version: v1.2.1
perception_interfaces:
type: git
url: https://github.com/ika-rwth-aachen/perception_interfaces.git
version: d908af198393c3b26bedea259080b5d7b1060716
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

This OpenADS service performs image instance segmentation through Triton Inference Server.
It supports multiple cameras, optional tracking, segmentation masks, 2D detections,
and debug overlays. Model weights and datasets are supplied separately.
and image-only perception object lists. Model weights and datasets are supplied separately.

<p align="center">
<strong>🚀 <a href="#-quick-start">Quick Start</a></strong> • <strong>💻 <a href="#-development">Development</a></strong> • <strong>📝 <a href="#-documentation">Documentation</a></strong>
Expand All @@ -32,7 +32,7 @@ and debug overlays. Model weights and datasets are supplied separately.

## 🚀 Quick Start

Run the demo with Triton, recorded camera images, and a segmentation overlay viewer:
Run the demo with Triton, recorded camera images, and an RViz view of the detected objects:

```bash
cd demo
Expand Down
15 changes: 10 additions & 5 deletions demo/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RF-DETR-Seg Demo

Four services run RF-DETR-Seg inference on a recorded camera stream: Triton,
rosbag playback, image instance segmentation, and `rqt_image_view`.
rosbag playback, image instance segmentation, and RViz.

Requires Docker Compose 2.35 or newer, NVIDIA Container Toolkit with a compatible
GPU/driver, and an X11 or XWayland display.
Expand All @@ -28,10 +28,15 @@ To customize the demo, copy `.env.example` to `.env` and edit the settings.
the Triton model image. Model and node settings are in
[config/params.yml](config/params.yml).

The viewer opens `/demo/overlay/instance`; select `/demo/overlay/class` in its
topic dropdown for class colors. Masks and boxes are published on
`/demo/class_mask`, `/demo/instance_mask`, and `/demo/detections`.
No calibration or TF is needed for these image-coordinate outputs.
RViz shows the image-only object lists `/demo/perception/road_users`,
`/demo/perception/traffic_signs`, and `/demo/perception/traffic_lights` in
separate panels: road users with boxes, masks, and track IDs on the matching
camera image, traffic signs and lights as their image crops. Panels can be
rearranged or floated as windows; the layout is in
[visualization/demo.rviz](visualization/demo.rviz). Full-frame masks and boxes
are published on `/demo/class_mask`, `/demo/instance_mask`, and
`/demo/detections`. No calibration or TF is needed for these image-coordinate
outputs.

The first start can take several minutes while TensorRT prepares the model.
Its cache is retained in a Docker volume for subsequent runs.
Expand Down
10 changes: 7 additions & 3 deletions demo/config/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@
tracking.max_lost_frames: 30
tracking.min_box_area_px: 25.0

debug.publish_overlay: true
# Image-only object lists with boxes, masks, and crops, shown by the RViz demo view.
perception.publish_road_users: true
perception.publish_traffic_lights: true
perception.publish_traffic_signs: true
perception.include_crops: true
perception.include_masks: true

debug.print_timing: false
debug.overlay_alpha: 0.45
debug.overlay_draw_boxes: true

cameras: [camera]
camera.camera.image_topic: "~/image"
Expand Down
11 changes: 6 additions & 5 deletions demo/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ services:
- class_mask_topic:=/demo/class_mask
- instance_mask_topic:=/demo/instance_mask
- detections_topic:=/demo/detections
- class_overlay_topic:=/demo/overlay/class
- instance_overlay_topic:=/demo/overlay/instance
- road_users_topic:=/demo/perception/road_users
- traffic_lights_topic:=/demo/perception/traffic_lights
- traffic_signs_topic:=/demo/perception/traffic_signs

bag-play:
image: ghcr.io/openads-project/monitoring:v1.0.0
Expand Down Expand Up @@ -94,7 +95,7 @@ services:
- --disable-keyboard-controls

visualization:
image: ghcr.io/openads-project/monitoring:v1.0.0
image: ${VISUALIZATION_IMAGE:-ghcr.io/openads-project/monitoring:v1.0.0}
depends_on:
image-instance-segmentation:
condition: service_started
Expand All @@ -105,8 +106,8 @@ services:
QT_X11_NO_MITSHM: "1"
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./visualization/open_image_view.py:/demo/open_image_view.py:ro
command: [python3, /demo/open_image_view.py]
- ./visualization/demo.rviz:/demo/demo.rviz:ro
command: [ros2, run, rviz2, rviz2, -d, /demo/demo.rviz]

volumes:
triton-cache:
86 changes: 86 additions & 0 deletions demo/visualization/demo.rviz
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
Panels:
- Class: rviz_common/Displays
Name: Displays
Visualization Manager:
Class: ""
Displays:
- Class: perception_msgs/ImageEvidence
Enabled: true
Name: Road users
Topic:
Value: /demo/perception/road_users
Depth: 5
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Best Effort
Image Source:
Value: Image topic
Image Topic: /demo/image
Transport: compressed
Synchronization: Synchronized
Tolerance [ms]: 5
Image Buffer: 60
Mask:
Value: true
Mode: Filled + contour
Alpha: 0.35
Label:
Value: true
Format: "{id} {class} {class_prob}"
Font Size: 14
- Class: perception_msgs/ImageEvidence
Enabled: true
Name: Traffic signs
Topic:
Value: /demo/perception/traffic_signs
Depth: 5
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Best Effort
Image Source:
Value: Crop mosaic
Mask:
Value: true
Mode: Contour
Color: Fixed
Label:
Value: true
Format: "{id} sign {exist}"
- Class: perception_msgs/ImageEvidence
Enabled: true
Name: Traffic lights
Topic:
Value: /demo/perception/traffic_lights
Depth: 5
Durability Policy: Volatile
History Policy: Keep Last
Reliability Policy: Best Effort
Image Source:
Value: Crop mosaic
Mask:
Value: true
Mode: Contour
Color: By object ID
Label:
Value: true
Format: "{id} light {exist}"
Global Options:
Fixed Frame: map
Views:
Current:
Class: rviz_default_plugins/Orbit
Distance: 15
Window Geometry:
Displays:
collapsed: false
Road users:
collapsed: false
Traffic signs:
collapsed: false
Traffic lights:
collapsed: false
Hide Left Dock: false
Hide Right Dock: true
QMainWindow State: 000000ff00000000fd000000010000000000000638000003e8fc0200000001fc00000000000003e80000002c00fffffffc0100000002fb000000100044006900730070006c0061007900730100000000000001040000003a00fffffffc0000010a0000052e0000007a00fffffffc0200000002fb000000140052006f006100640020007500730065007200730100000000000002730000001300fffffffc000002790000016f0000001300fffffffc0100000002fb0000001a00540072006100660066006900630020007300690067006e0073010000010a000002940000003a00fffffffb0000001c00540072006100660066006900630020006c0069006700680074007301000003a4000002940000003a00ffffff00000002000003e800000004000000040000000800000008fc00000000
Width: 1600
Height: 1000
36 changes: 0 additions & 36 deletions demo/visualization/open_image_view.py

This file was deleted.

12 changes: 7 additions & 5 deletions deployment/compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:

image-instance-segmentation:
image: ghcr.io/openads-project/image_instance_segmentation:v1.1.0
image: ghcr.io/openads-project/image_instance_segmentation:v1.2.0
environment:
# --- name ------
NAMESPACE: /
Expand All @@ -12,8 +12,9 @@ services:
CLASS_MASK_TOPIC: ~/segmentation/class_mask
INSTANCE_MASK_TOPIC: ~/segmentation/instance_mask
DETECTIONS_TOPIC: ~/segmentation/detections
CLASS_OVERLAY_TOPIC: ~/debug/overlay/class
INSTANCE_OVERLAY_TOPIC: ~/debug/overlay/instance
ROAD_USERS_TOPIC: ~/perception/road_users
TRAFFIC_LIGHTS_TOPIC: ~/perception/traffic_lights
TRAFFIC_SIGNS_TOPIC: ~/perception/traffic_signs
LOG_LEVEL: ${LOG_LEVEL:-info}
USE_SIM_TIME: ${USE_SIM_TIME:-false}
PARAMS: /docker-ros/ws/install/image_instance_segmentation/share/image_instance_segmentation/config/params.yml
Expand All @@ -36,7 +37,8 @@ services:
class_mask_topic:=$${CLASS_MASK_TOPIC} \
instance_mask_topic:=$${INSTANCE_MASK_TOPIC} \
detections_topic:=$${DETECTIONS_TOPIC} \
class_overlay_topic:=$${CLASS_OVERLAY_TOPIC} \
instance_overlay_topic:=$${INSTANCE_OVERLAY_TOPIC}
road_users_topic:=$${ROAD_USERS_TOPIC} \
traffic_lights_topic:=$${TRAFFIC_LIGHTS_TOPIC} \
traffic_signs_topic:=$${TRAFFIC_SIGNS_TOPIC}
# volumes:
# - ./params.yml:/docker-ros/ws/install/image_instance_segmentation/share/image_instance_segmentation/config/params.yml
4 changes: 2 additions & 2 deletions deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: image-instance-segmentation
version: 1.1.0
appVersion: 1.1.0
version: 1.2.0
appVersion: 1.2.0
description: ROS 2 Image Instance Segmentation for Automated Driving
dependencies:
- repository: oci://ghcr.io/openads-project/openads-helm
Expand Down
12 changes: 7 additions & 5 deletions deployment/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
openadservice:
name: image-instance-segmentation
image: ghcr.io/openads-project/image_instance_segmentation:v1.1.0
image: ghcr.io/openads-project/image_instance_segmentation:v1.2.0
env:
# --- name ------
NAMESPACE: /
Expand All @@ -11,8 +11,9 @@ openadservice:
CLASS_MASK_TOPIC: ~/segmentation/class_mask
INSTANCE_MASK_TOPIC: ~/segmentation/instance_mask
DETECTIONS_TOPIC: ~/segmentation/detections
CLASS_OVERLAY_TOPIC: ~/debug/overlay/class
INSTANCE_OVERLAY_TOPIC: ~/debug/overlay/instance
ROAD_USERS_TOPIC: ~/perception/road_users
TRAFFIC_LIGHTS_TOPIC: ~/perception/traffic_lights
TRAFFIC_SIGNS_TOPIC: ~/perception/traffic_signs
LOG_LEVEL: info
USE_SIM_TIME: false
PARAMS: /docker-ros/ws/install/image_instance_segmentation/share/image_instance_segmentation/config/params.yml
Expand All @@ -35,7 +36,8 @@ openadservice:
class_mask_topic:=${CLASS_MASK_TOPIC} \
instance_mask_topic:=${INSTANCE_MASK_TOPIC} \
detections_topic:=${DETECTIONS_TOPIC} \
class_overlay_topic:=${CLASS_OVERLAY_TOPIC} \
instance_overlay_topic:=${INSTANCE_OVERLAY_TOPIC}
road_users_topic:=${ROAD_USERS_TOPIC} \
traffic_lights_topic:=${TRAFFIC_LIGHTS_TOPIC} \
traffic_signs_topic:=${TRAFFIC_SIGNS_TOPIC}
rosParamFileMountPath: /docker-ros/ws/install/image_instance_segmentation/share/image_instance_segmentation/config/params.yml
rosParamFileData: null
42 changes: 36 additions & 6 deletions docs/IMPLEMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ List camera names in `cameras` and configure each under `camera.<name>`:

| Parameter | Meaning |
| --- | --- |
| `camera.<name>.sensor_id` | Unique camera ID for perception evidence; defaults to its 1-based position in `cameras` |
| `camera.<name>.image_topic` | Base image topic |
| `camera.<name>.transport` | `raw` or `compressed`; omit `/compressed` from the base topic |
| `camera.<name>.output_prefix` | Prefix for segmentation and overlay outputs |
| `camera.<name>.output_prefix` | Prefix for camera output topics |

The supplied parameter file configures one camera with raw transport, enables
tracking, and selects RF-DETR-Seg decoding.
Expand All @@ -36,7 +37,34 @@ reused after a track ends.

In the topic tables, `config.image_topic` is the configured input and `joinTopic`
places outputs under the camera's prefix. Parameter names `image_topic`,
`transport`, and `output_prefix` are per-camera suffixes.
`sensor_id`, `transport`, and `output_prefix` are per-camera suffixes.

## Perception objects

Enable each object-list output independently at startup:

```yaml
perception.publish_road_users: true
perception.publish_traffic_lights: true
perception.publish_traffic_signs: true
```

Topics are `perception/road_users`, `perception/traffic_lights` and
`perception/traffic_signs` under each camera's output prefix. They carry
`perception_msgs/msg/ObjectListWithEvidence` with `HEXAMOTION`, `TRAFFICLIGHT` and `TRAFFICSIGN`
states respectively. Metric components remain unmeasured; light state, sign type
and road-user light states remain unknown.

The standard `model.class_names` select the category and road-user classification,
independently of `model.class_ids`. Unmapped names remain in segmentation outputs.
Object IDs persist for a tracked object's lifetime and are not recycled when
mask IDs are reused. Without tracking, each published detection gets a
fresh ID. IDs are scoped to a camera stream and node lifetime.

Image evidence retains source coordinates and headers. `perception.include_crops`
and `perception.include_masks` independently include BGR crops and binary `mono8`
ROI masks. Pixels are prepared only for subscribed outputs; empty lists are
published for processed frames without matching detections.

## Triton model

Expand Down Expand Up @@ -77,8 +105,10 @@ Cameras run concurrently with one Triton client each. Busy cameras drop frames
at the admission limit. Set `prediction.max_in_flight_per_camera: 1` for low
latency; tracking enforces this limit to preserve frame order.

Enable `debug.publish_overlay` for overlays and `debug.print_timing` for
processing times.
Enable `debug.print_timing` for processing times. To inspect results, enable
the `perception.publish_*` object lists and view their image evidence with
the `perception_msgs/ImageEvidence` RViz display from
[perception_interfaces](https://github.com/ika-rwth-aachen/perception_interfaces).
Use `ros_tracing:=true` to enable OpenADS dual-session tracing. Service images
include the `jazzy-ika` tracing fork.

Expand Down Expand Up @@ -123,8 +153,8 @@ All settings below have the prefix `diagnostic_updater.` and are read-only.
| `<camera>.<output>.nominal_frequency` | `0.0` Hz, disabling that topic check |
| `<camera>.<output>.min_frequency` / `max_frequency` | `0.8` / `1.2` times nominal frequency |

`<output>` is `input`, `class_mask`, `instance_mask` or `detections`; overlays are
demand-driven. Rate checks use five reports and the ROS clock. Output timestamp
`<output>` is `input`, `class_mask`, `instance_mask` or `detections`; perception
object lists are demand-driven. Rate checks use five reports and the ROS clock. Output timestamp
limits add `processing.timeout` to `inputs.max_age`. Topic details under
`topic.<camera>.<output>` are `frequency_hz`, `{min,max,target}_frequency_hz`,
`events_in_window`, `events_since_start`, `window_s`, `{min,max}_delay_s`,
Expand Down
Loading
Loading