Downloads Β· 30 days
0
OpenTraffic/opentraffic-perception-engine
opentraffic-perception-engine is a object detection model from OpenTraffic. Use it when you need objects located in an image. It is set up for custom. The card lists the license as apache-2.0.
<div align="center" <img src="https://huggingface.co/buckets/OpenTraffic/opentraffic-perception-engine/resolve/opentraffic-perception-engine-main/figure/LOGO2x.png" width="70%" /
Downloads Β· 30 days
0
Access
Public
Updated Sep 2, 2026
Repo size
42.7 MB
Likes
0
Public
Click a slice to open those files.
.pt42.7 MB Β· 100%
From the Hugging Face model README
Supports multi-stream RTSP input, YOLO11 + DeepSort detection and tracking, homography-based coordinate transformation, world velocity estimation, lane-level structured output, and radar-reference validation. Designed for Perception-Driven TSC scenarios.
<div align="center"> <img src="https://huggingface.co/buckets/OpenTraffic/opentraffic-perception-engine/resolve/opentraffic-perception-engine-main/figure/Framework.png" width="90%"> </div> <br/>Paper: https://arxiv.org/abs/XXXX.XXXXX
Project Page: https://opentraffic-team.github.io/tir
HuggingFace: https://huggingface.co/OpenTraffic-Team
GitHub: https://github.com/OpenTraffic-Team/Tir
<br/>βΆοΈ Click to watch the demo video
<br/>| Item | Requirement |
|---|---|
| OS | Linux x86_64 |
| NVIDIA Driver | β₯ 560 |
| CUDA | 12.6 |
| Python | 3.13+ |
| PyTorch | 2.11.0+cu126 |
# Clone the repository
git clone https://github.com/OpenTraffic-Team/opentraffic-perception-engine.git
cd opentraffic-perception-engine-main/opentraffic-TIR
# Install dependencies
pip install -r requirements.txt
redis-server redis.conf
Use mediamtx to serve local video as RTSP:
./mediamtx mediamtx.yml
Or use VLC to stream:
vlc video.mp4 --sout '#rtp{sdp=rtsp://:8554/test}'
Or use a local video path directly: Set the rtsp_url field in drivers/config.json to a local file path (e.g. input/45_0429.mp4).
Test video: https://pan.baidu.com/s/1qULF2WcxUP_l5Cvs9uV-JA Password: 1234
./run_local.sh
Stop:
./stop_local.sh
<br/>
Edit opentraffic-TIR/drivers/config.json.
| Field | Type | Description |
|---|---|---|
id | string | Camera ID, format: {intersection_id}_{direction} |
rtsp_url | string | RTSP URL or local video file path |
window | [x1, y1, x2, y2] | Detection crop window; use [0, 0, 1920, 1080] for full frame |
H | 3Γ3 matrix | Pixel β radar homography matrix |
H_inv | 3Γ3 matrix | Radar β pixel inverse matrix (auto-computed from H if omitted) |
radar_variant | string | Coordinate variant, default "default" |
radar_redis_key | string | Redis key for this camera's output |
| Field | Description |
|---|---|
debugMode | Enable verbose tracking logs |
jsonlOutputDir | JSONL output directory |
radarReferenceJsonl | Radar reference file for validation |
matchTargetDir | Radar JSON output directory for cross-modal ID matching |
matchTimeMaxDeltaMs | Max timestamp matching tolerance (ms) |
vehicleMatchMaxDist | Max vehicle center matching distance (meters) |
localRedisConfig.host | Redis server address |
localRedisConfig.password | Redis password |
data_processing.upload_interval_sec | JSON merge and upload interval (seconds) |
{
"intersection": {
"id": "HHL_QHDD",
"name": "Honghua Road",
"cameras": [
{
"id": "HHL_QHDD_S",
"rtsp_url": "./input/45_0429.mp4",
"window": [0, 0, 1920, 1080],
"H": [[...], [...], [...]],
"H_inv": [[...], [...], [...]],
"radar_variant": "default",
"radar_redis_key": "origin_info_state:HHL_QHDD"
}
]
},
"debugMode": false,
"jsonlOutputDir": "./control_group_fullspeed_jsonl",
"radarReferenceJsonl": "./reference_radar/HHL_QHDD_S/HHL_QHDD_S_shard_00000.jsonl",
"vehicleMatchMaxDist": 10.0,
"localRedisConfig": {
"host": "127.0.0.1",
"port": 6379,
"db": 0,
"password": "your_password"
},
"data_processing": {
"upload_interval_sec": 1
}
}
<br/>
.so for acceleration; outputs structured target IDs for downstream use.SimpleVelocityEstimator estimates target velocity in world coordinates.This section applies to the self-contained .so delivery package, which runs without the full source code.
| Resource | Path |
|---|---|
| Input video | input/45_0429.mp4 |
| Radar reference data | reference_radar/HHL_QHDD_S/HHL_QHDD_S_shard_00000.jsonl |
| Python environment | .venv |
| Start script | run_local.sh |
| Stop script | stop_local.sh |
Start:
cd /tir-0513-git-so
./run_local.sh
Stop:
cd /tir-0513-git-so
./stop_local.sh
Default output directory:
control_group_fullspeed_jsonl/HHL_QHDD_S/HHL_QHDD_S_shard_00000.jsonl
Output JSONL fields:
| Field | Description |
|---|---|
timestamp_ms | Frame timestamp (milliseconds) |
intersection_id | Intersection ID |
camera_id | Camera ID |
source | Data source |
coordinate_space | Coordinate space |
vehicles[].id | Vehicle ID |
vehicles[].center | Vehicle center coordinates (meters) |
vehicles[].speed | Velocity vector (m/s) |
vehicles[].speed_scalar | Speed scalar (m/s) |
vehicles[].lane | Lane |
vehicles[].type | Vehicle type |
Results are written to two Redis keys:
recognition_{camera_id}_snaprecognition_{camera_id}Merged four-direction snapshot format (origin_info_state:{intersection_id}):
{
"code": "HHL_QHDD",
"name": "Honghua Road",
"recognitionSnap[HHL_QHDD_E]": {
"timestamp": 1734400000.0,
"vehicles": [
{
"id": "42",
"orig_id": "7",
"type": "",
"lane": "",
"center": [12.5, 8.3],
"speed": [3.2, -1.1],
"licenseNum": ""
}
]
}
}
| Field | Description |
|---|---|
timestamp | Frame timestamp in seconds (extracted via OCR) |
id | Target ID after radar matching |
orig_id | Original visual tracking ID (before matching) |
center | World coordinates [x, y] in meters |
speed | Velocity components [vx, vy] in m/s |
type | Vehicle type (if available) |
licenseNum | License plate number (if available) |
Evaluation: historical full-set speed JSONL vs. raw radar JSONL.
| Field | Mean | Median (p50) | p75 | p90 | Notes |
|---|---|---|---|---|---|
timestamp_ms error (ms) | 25.04 | 26.5 | 37 | 46 | Time delta between video frame and nearest radar frame |
vehicles[].center error (m) | 2.5132 | 1.6251 | 3.1987 | 6.7021 | Spatial position error of matched targets |
vehicles[].speed_scalar error (m/s) | 1.6727 | 0.3176 | 1.7741 | 5.0061 | Speed scalar error of matched targets |
| Field | Comparison | Consistency |
|---|---|---|
intersection_id | Exact match | 100% |
camera_id | Exact match | 100% |
coordinate_space | Exact match | 100% |
timestamp_ms | Aligned within 200ms | 100% |
vehicles[].lane | Exact match with radar | 100% |
OpenTraffic Perception System for Perception-Driven TSCIn preparation / pending releasehttps://arxiv.org/abs/XXXX.XXXXXhttps://huggingface.co/OpenTraffic-Teamhttps://github.com/OpenTraffic-Team/TirComing soonIf TIR is useful for your research, please cite:
@article{tir2026,
title = {TIR: Real-Time Traffic Situation Awareness for Urban Intersections},
author = {OpenTraffic Team},
journal = {arXiv preprint},
year = {2026}
}
<br/>
This project is released under the Apache 2.0 License.