2D Single Camera Detection and Tracking (RT-DETR)
The Real Time Video Intelligence CV Microservice leverages NVIDIA DeepStream SDK to generate metadata for each stream that downstream microservices can use to generate spatial metrics and alerts.
The microservice features metropolis-perception-app, a DeepStream pipeline that builds on the built-in deepstream-test5 app in the DeepStream SDK.
This perception app provides a complete application that takes streaming video inputs, decodes the incoming streams, performs inference & tracking, and sends the metadata to other microservices using the defined Protobuf schema.
The application features a modular architecture that integrates preprocessing plugins and RT-DETR (Real-Time Detection Transformer), specifically designed for 2D single-camera object detection and tracking in warehouse environments.
RT-DETR is an advanced real-time detection transformer that generates precise 2D bounding boxes for diverse objects including people, humanoid robots, autonomous vehicles, and warehouse equipment. The model features a ResNet-50 backbone, pretrained on warehouse scene datasets for accurate 2D object detection in industrial environments. Refer to the TAO RT-DETR fine-tuning page for more details on the model architecture and training process.
The pipeline ingests single-camera video streams, performs real-time 2D object detection, and utilizes DeepStream’s tracking capabilities to maintain object identity across frames. Detection results include 2D bounding boxes, class labels, confidence scores, and instance IDs, enabling sophisticated tracking and analytics capabilities.
For detailed information on all components, APIs, and customization options, refer to the Object Detection and Tracking.
The diagram below shows the perception pipeline used in the microservice:

Configurations
The Perception microservice requires several configuration files that control various aspects of the 2D single-camera detection and tracking system. These files allow users to customize the system’s behavior according to their specific requirements.
Docker Compose Volume Mounts
For docker compose deployment, the perception-2d service in deploy/docker/industry-profiles/warehouse-operations/warehouse-2d-app/warehouse-2d-app.yml mounts host paths into the container as follows:
The $VSS_DATA_DIR/models/ host directory is mounted at /opt/storage/, which persists ONNX models and TensorRT engine files across container restarts. DeepStream pipeline configs (ds-main-config.txt, ds-pgie-config.yml, and related files) live on the host under $VSS_APPS_DIR/industry-profiles/warehouse-operations/warehouse-2d-app/deepstream/configs/ and appear in the container under metropolis_perception_app/configs/.
Inference Configuration File
The main configuration file for RT-DETR, ds-pgie-config.yml, handles properties related to model inference and controls the core functionality of the 2D detection system. This YAML configuration file contains two main sections: property and class-attrs-all.
Model and Inference Properties
Input/Output Properties
Detection and Filtering Properties
DeepStream Configuration File
The DeepStream main configuration file (ds-main-config.txt) builds on the DeepStream test5 application configuration and provides essential settings for the overall pipeline. This file controls various aspects of the application, including source configuration, stream multiplexing, message broker settings, and visualization parameters.
Key Configuration Sections
For a complete understanding of all configuration options, refer to the DeepStream SDK Documentation.
Tracker Configuration File
The tracker configuration files configure the object tracking component that maintains object identity across frames. The tracker configuration consists of two files:
- Tracker plugin configuration in
ds-main-config.txtunder the[tracker]section - Low-level tracker configuration in
ds-nvdcf-accuracy-tracker-config.yml
RT-DETR performs detection, and the NvDCF (NVIDIA Discriminative Correlation Filter) tracker associates detections across time to generate consistent object IDs.
For detailed information about the tracker configuration parameters and options, refer to the DeepStream Tracker Plugin Documentation.
Tracker Plugin Configuration (in ds-main-config.txt)
Low-Level Tracker Configuration (ds-nvdcf-accuracy-tracker-config.yml)
The NvDCF tracker configuration file contains advanced parameters for fine-tuning tracker behavior. Key configuration sections include:
BaseConfig: Basic tracker confidence thresholdsTargetManagement: Object lifecycle management (max targets, probation age, termination)TrajectoryManagement: Track association and re-identification settingsDataAssociator: Data association algorithm parameters (IOU, visual similarity)StateEstimator: Kalman filter parameters for motion predictionVisualTracker: Visual feature extraction settings (HOG, color features)ReID: Re-identification network configuration (optional)
For most use cases, the default NvDCF accuracy configuration provides robust tracking without modification.
Kafka Configuration File
The ds-kafka-config.txt file contains the Kafka configuration parameters for the Perception microservice. This file configures the Kafka producer and consumer settings for the Perception microservice.
The partition key setting ensures that messages from the same sensor go to the same Kafka partition, maintaining message ordering per camera stream.
Labels File
The ds-detector-labels.txt file contains the class labels that the RT-DETR model can detect. Each line in the file corresponds to a class that the model recognizes. Users can customize this file to match their specific detection requirements.
The file format uses a newline-separated list of object class names:
These class labels represent the 7 object categories that the RT-DETR warehouse model can detect:
- Person: Human workers in warehouse environments
- Agility_Digit_Humanoid: Agility Robotics Digit humanoid robot
- Fourier_GR1_T2_Humanoid: Fourier Intelligence GR1_T2 humanoid robot
- Nova_Carter: NVIDIA Nova Carter autonomous mobile robot
- Transporter: Warehouse transport vehicles
- Forklift: Industrial forklifts
- Pallet: Warehouse pallets and cargo containers
Runtime Configuration Adjustments
This section covers common configuration changes that users may need to make when adapting the RT-DETR pipeline for their specific deployment scenarios.
Modifying the Number of Input Streams
When updating the number of input streams/cameras, you must update the batch size settings in the configuration files to ensure consistency. RT-DETR processes each camera stream independently, making it straightforward to scale to multiple cameras.
The related deepstream configuration files can be found in the following directory for docker compose deployment: deploy/docker/industry-profiles/warehouse-operations/warehouse-2d-app/deepstream/configs
Update DeepStream Configuration
Modify the ds-main-config.txt file to update source and batch size settings:
The default configuration uses dynamic source management (use-nvmultiurisrcbin=1), which allows adding/removing camera streams at runtime via HTTP API without restarting the application. The max-batch-size parameter sets the upper limit for concurrent streams.
Integrating a New RT-DETR Model
The RT-DETR pipeline supports model swapping, allowing you to use different RT-DETR models based on your specific use case, such as models fine-tuned on custom datasets via TAO Toolkit.
Model Compatibility Requirements
Ensure your new model meets these requirements:
- Exported as ONNX format from TAO Toolkit with
serialize_nvdsinfer: true - Uses the same input dimensions (640x640 or compatible resolution)
- Has compatible output tensors (
pred_boxesandpred_logits) - Follows the RT-DETR architecture pattern for 2D object detection
Update RT-DETR Configuration
- Place your new model file and label file in the appropriate directories on the host. The container accesses them through the volume mounts shown in Docker Compose Volume Mounts:
- Place your new ONNX model (for example,
your_new_rtdetr_model.onnx) in$VSS_DATA_DIR/models/on the host. - Place your new labels file (for example,
your_new_labels.txt) in$VSS_APPS_DIR/industry-profiles/warehouse-operations/warehouse-2d-app/deepstream/configs/on the host.
- Update the
ds-pgie-config.ymlaccordingly:
The Perception microservice automatically builds the TensorRT engine for the new model on first run. Engine files persist under $VSS_DATA_DIR/models/ (mounted at /opt/storage/ in the container).
Your labels file must list labels in the same order your model was trained with.
- Update input dimensions if your model uses different resolution:
- Adjust detection threshold if needed:
- Update output blob names if your model uses different tensor names:
After making these changes, restart the Perception microservice for the changes to take effect. For detailed instructions on fine-tuning RT-DETR models via TAO Toolkit, refer to the TAO RT-DETR fine-tuning page.