UniTraffic-Agent

Unified Traffic Video Reasoning for AI City Challenge 2026 Track 3 with Two Out-of-Domain Evaluations

2
Stars
0
Forks
Python
Language
MIT
License

Three-Track Unified System

🚦

Track 3 / TAR

Traffic anomaly reasoning system using one multimodal interface for comprehensive video analysis and reasoning.

📹

Track 7 / FETV

Fisheye traffic-violation recognition with fixed question schema and deterministic output normalization.

🚶

Track 8 / PSI VQA

Pedestrian intention and driver-decision reasoning with representative examples per task.

Competition Results

Evaluation Team Rank Final Score Entry Point
Track 3 / TAR 139 16 0.5780 python -m aicity_agent track3
Track 7 / FETV 139 2 0.4884 python -m aicity_agent track7
Track 8 / PSI VQA 139 4 64.4161 python -m aicity_agent track8

Method Overview

Each video is converted into an ordered timestamped frame pack. All questions or output fields for one video are placed in one task contract and answered in one multimodal request.

Frame Sampling

Timestamp-aware global and anchor frame sampling for comprehensive video coverage

Task Contracts

JSON or CSV output contracts for specific track requirements

Lexical Retrieval

Training-example retrieval for TAR text answers

Deterministic Output

Output normalization and validation for consistent results

Caching System

Frame and API-response caches for resumable inference

python -m aicity_agent track3 --help
python -m aicity_agent track7 --help
python -m aicity_agent track8 --help

Repository Structure

. |-- README.md
|-- LICENSE
|-- requirements.txt
|-- .env.example
|-- aicity_agent/
| |-- __main__.py
| |-- core.py
| |-- prompts.py
| `-- __init__.py
|-- track3/
| `-- infer.py
|-- track7/
| `-- infer.py
`-- track8/
`-- infer.py

Quick Setup

Environment Setup

python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

API Configuration

cp .env.example .env
# Edit .env. Never commit it.
set -a
source .env
set +a

Reproduce Results

Track 3 Command:

export TAR_SNAPSHOT=/path/to/PhysicalAI-Traffic-Anomaly-Reasoning
export TAR_MEDIA_ROOT=/path/to/downloaded/tar/videos
python -m aicity_agent track3 \ --test-json "$TAR_SNAPSHOT/test/test.json" \ --media-root "$TAR_MEDIA_ROOT" \ --evaluate-py "$TAR_SNAPSHOT/test/evaluate.py" \ --train-root "$TAR_SNAPSHOT/train" \ --out-csv outputs/track3_final/submission.csv \ --report-json outputs/track3_final/report.json \ --validate

Track 7 Command:

export FETV_VIDEO_ROOT=/path/to/FETV_public_clips
python -m aicity_agent track7 \ --video-root "$FETV_VIDEO_ROOT" \ --output-json outputs/track7_final/submission.json \ --report-json outputs/track7_final/report.json

Track 8 Command:

export PSI_DATA_ROOT=/path/to/PSI_VQA
python -m aicity_agent track8 \ --test-root "$PSI_DATA_ROOT/test_public" \ --media-root "$PSI_DATA_ROOT/test_public/videos" \ --train-root "$PSI_DATA_ROOT/train" \ --out-csv outputs/track8_final/submission.csv \ --report-json outputs/track8_final/report.json

License & Terms

MIT License

The source code is released under the MIT License. Dataset annotations, videos, and embedded public examples retain their original licenses and terms.

This release does not redistribute challenge videos, test annotations, hidden annotations, or manual labels. Public training annotations are used only for prompt examples and lexical style retrieval.

Data Sources