-
Notifications
You must be signed in to change notification settings - Fork 83
ITEP-82981: Add Smart Traffic Agent #1491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
madhuri-rai07
merged 10 commits into
open-edge-platform:main
from
sarthakdeva-intel:add_itt
Jan 9, 2026
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
39bbf9e
ITEP-82981: Add Smart Traffic Agent
sarthakdeva-intel 7cd43d8
Remove Gamification
sarthakdeva-intel a7a6415
Clean pyproject metadata
sarthakdeva-intel 8d5d59f
Update name
sarthakdeva-intel d064083
Adding .dockerignore and updated .gitignore file
krish918 b9e1dd4
♻️ Updated Dockerfile and removed unused variables
krish918 55de06f
Merge branch 'main' into add_itt
bharagha 9088856
♻️ Re-organized code structure
krish918 63030e3
🙈 updated gitignore, dockerignore and docker compose
krish918 ef058ce
Merge branch 'main' into add_itt
madhuri-rai07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
89 changes: 89 additions & 0 deletions
89
metro-ai-suite/smart-traffic-intersection-agent/.gitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Copyright (C) 2026 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| .python-version | ||
|
|
||
| # Ignore environment variables | ||
| .env | ||
|
|
||
| # Ignore Python cache files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *.py[codz] | ||
| *$py.class | ||
|
|
||
| # Ignore virtual environment directories | ||
| venv/ | ||
| env/ | ||
| .venv/ | ||
| .env/ | ||
|
|
||
| # Ignore log files | ||
| *.log | ||
|
|
||
| # Ignore IDE specific files | ||
| .vscode/ | ||
|
|
||
| *.manifest | ||
| *.spec | ||
|
|
||
| .DS_Store | ||
| .idea/ | ||
| logs/ | ||
|
|
||
| # Ignore model files | ||
| ov-model/ | ||
| ov-models/ | ||
|
|
||
|
|
||
| # Ignore pytest cache | ||
| .pytest_cache/ | ||
|
|
||
| # Ignore pytest result files | ||
| *.pytest_cache | ||
|
|
||
| # pytest related dir | ||
| empty_model_dir | ||
| mock_model_dir | ||
| .coverage | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| *.py.cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
| cover/ | ||
|
|
||
| # secrets | ||
| **/secrets | ||
| **/secrets/ca | ||
| **/secrets/certs | ||
| **/secrets/django | ||
| **/secrets/*.auth | ||
| **/secrets/supass | ||
| **/dlstreamer-pipeline-server/videos/**.ts | ||
|
|
||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| share/python-wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| **/edge-ai-suites/ |
File renamed without changes.
127 changes: 127 additions & 0 deletions
127
metro-ai-suite/smart-traffic-intersection-agent/docker/compose.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| # Copyright (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: scene-intelligence | ||
|
|
||
| secrets: | ||
| root-cert: | ||
| file: ../edge-ai-suites/metro-ai-suite/metro-vision-ai-app-recipe/smart-intersection/src/secrets/certs/scenescape-ca.pem | ||
|
|
||
| services: | ||
| # VLM OpenVINO Serving Service | ||
| vlm-openvino-serving: | ||
| image: intel/vlm-openvino-serving:1.3.1 | ||
| ports: | ||
| - "${VLM_SERVICE_PORT:-9764}:8000" | ||
| ipc: host | ||
| networks: | ||
| - scenescape | ||
| environment: | ||
| # Proxy settings | ||
| no_proxy_env: ${no_proxy_env},${HOST_IP} | ||
| no_proxy: ${no_proxy_env},${HOST_IP} | ||
| http_proxy: ${http_proxy} | ||
| https_proxy: ${https_proxy} | ||
| # VLM Model configuration | ||
| VLM_MODEL_NAME: ${VLM_MODEL_NAME:-Qwen/Qwen2.5-VL-3B-Instruct} | ||
| VLM_COMPRESSION_WEIGHT_FORMAT: ${VLM_COMPRESSION_WEIGHT_FORMAT:-int4} | ||
| VLM_DEVICE: ${VLM_DEVICE:-CPU} | ||
madhuri-rai07 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| VLM_SEED: ${VLM_SEED:-42} | ||
| WORKERS: ${VLM_WORKERS:-1} | ||
madhuri-rai07 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| VLM_MAX_COMPLETION_TOKENS: ${VLM_MAX_COMPLETION_TOKENS:-1500} | ||
| HUGGINGFACE_TOKEN: ${HUGGINGFACE_TOKEN} | ||
| OV_CONFIG: ${OV_CONFIG} | ||
| VLM_LOG_LEVEL: ${VLM_LOG_LEVEL:-info} | ||
| OPENVINO_LOG_LEVEL: ${VLM_OPENVINO_LOG_LEVEL:-1} | ||
| VLM_ACCESS_LOG_FILE: ${VLM_ACCESS_LOG_FILE:-/dev/null} | ||
| restart: unless-stopped | ||
| devices: | ||
| - /dev/dri:/dev/dri | ||
| group_add: | ||
| - ${USER_GROUP_ID:-1000} | ||
| - ${VIDEO_GROUP_ID:-44} | ||
| - ${RENDER_GROUP_ID:-109} | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"] | ||
| interval: 10s | ||
| timeout: 10s | ||
| retries: 60 | ||
| start_period: 10s | ||
| volumes: | ||
| - ov-models:/root/.cache/huggingface | ||
| - ov-models:/app/ov-model | ||
|
|
||
| # Traffic Intelligence Service | ||
| traffic-intelligence: | ||
| build: | ||
| context: ../src | ||
| dockerfile: Dockerfile | ||
| image: ${REGISTRY:-}traffic-intelligence:${TAG:-latest} | ||
| ports: | ||
| - "${TRAFFIC_INTELLIGENCE_PORT:-8081}:8081" | ||
| - "${TRAFFIC_INTELLIGENCE_UI_PORT:-7860}:7860" | ||
| networks: | ||
| - scenescape | ||
| depends_on: | ||
| vlm-openvino-serving: | ||
| condition: service_healthy | ||
| environment: | ||
| # Service configuration | ||
| TRAFFIC_INTELLIGENCE_HOST: 0.0.0.0 | ||
| TRAFFIC_INTELLIGENCE_PORT: ${TRAFFIC_INTELLIGENCE_PORT:-8081} | ||
| LOG_LEVEL: ${LOG_LEVEL:-INFO} | ||
|
|
||
| # UI configuration | ||
| TRAFFIC_INTELLIGENCE_UI_PORT: ${TRAFFIC_INTELLIGENCE_UI_PORT:-7860} | ||
| USE_API: "true" | ||
| API_URL: http://localhost:${TRAFFIC_INTELLIGENCE_PORT:-8081}/api/v1/traffic/current | ||
| REFRESH_INTERVAL: ${REFRESH_INTERVAL:-15} | ||
|
|
||
| # Proxy settings | ||
| http_proxy: ${http_proxy} | ||
| https_proxy: ${https_proxy} | ||
| no_proxy: ${no_proxy_env},.scenescape.intel.com,${HOST_IP},broker.scenescape.intel.com,vlm-openvino-serving | ||
| NO_PROXY: ${no_proxy_env},.scenescape.intel.com,${HOST_IP},broker.scenescape.intel.com,vlm-openvino-serving | ||
| HTTP_PROXY: ${http_proxy} | ||
| HTTPS_PROXY: ${https_proxy} | ||
|
|
||
| # MQTT configuration (connects to broker service) | ||
| MQTT_HOST: ${MQTT_HOST:-broker.scenescape.intel.com} | ||
| MQTT_PORT: ${MQTT_PORT:-1883} | ||
|
|
||
| # Intersection configuration (overrides config/traffic_intelligence.json) | ||
| INTERSECTION_NAME: ${INTERSECTION_NAME:-Intersection-1} | ||
| INTERSECTION_LATITUDE: ${INTERSECTION_LATITUDE:-37.7049108} | ||
| INTERSECTION_LONGITUDE: ${INTERSECTION_LONGITUDE:--121.9096158} | ||
|
|
||
| # Weather configuration (overrides config/traffic_intelligence.json) | ||
| WEATHER_MOCK: ${WEATHER_MOCK:-true} | ||
|
|
||
| # VLM configuration (overrides config/traffic_intelligence.json) | ||
| VLM_MODEL: ${VLM_MODEL_NAME:-Qwen/Qwen2.5-VL-3B-Instruct} | ||
|
|
||
| # Traffic analysis configuration (overrides config/traffic_intelligence.json) | ||
| HIGH_DENSITY_THRESHOLD: ${HIGH_DENSITY_THRESHOLD:-10} | ||
|
|
||
| volumes: | ||
| - ../src/config:/app/config:ro | ||
| - traffic-intelligence-data:/app/data | ||
| secrets: | ||
| - source: root-cert | ||
| target: /app/secrets/certs/scenescape-ca.pem | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "curl -f http://localhost:8081/health || exit 1"] | ||
| interval: ${HEALTH_CHECK_INTERVAL:-30s} | ||
| timeout: ${HEALTH_CHECK_TIMEOUT:-10s} | ||
| retries: ${HEALTH_CHECK_RETRIES:-3} | ||
| start_period: ${HEALTH_CHECK_START_PERIOD:-10s} | ||
| restart: unless-stopped | ||
|
|
||
| volumes: | ||
| ov-models: | ||
| traffic-intelligence-data: | ||
|
|
||
| networks: | ||
| scenescape: | ||
| external: true | ||
| name: metro-vision-ai-app-recipe_scenescape | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| .. toctree:: | ||
|
|
||
| user-guide/index |
14 changes: 14 additions & 0 deletions
14
metro-ai-suite/smart-traffic-intersection-agent/docs/user-guide/Overview.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Scene Intelligence microservice | ||
|
|
||
| The Scene Intelligence microservice is a comprehensive traffic analysis service that provides real-time intersection monitoring, directional traffic density analysis, and Vision Language Model (VLM) powered traffic insights. It processes MQTT traffic data, manages camera images, and delivers intelligent traffic analysis through RESTful APIs. | ||
|
|
||
| ## Overview | ||
|
|
||
| The microservice processes real-time traffic data from MQTT streams and provides advanced analytics including directional traffic density monitoring, VLM-powered traffic scene analysis, and comprehensive traffic summaries. It supports sliding window analysis, sustained traffic detection, and intelligent camera image management for enhanced traffic insights. | ||
|
|
||
|
|
||
| ## Supporting Resources | ||
|
|
||
| - [Get Started Guide](get-started.md) | ||
| - [API Reference](api-reference.md) | ||
| - [System Requirements](system-requirements.md) |
92 changes: 92 additions & 0 deletions
92
metro-ai-suite/smart-traffic-intersection-agent/docs/user-guide/api-docs/openapi.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| --- | ||
| openapi: 3.1.0 | ||
madhuri-rai07 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| info: | ||
| title: Traffic Intelligence API | ||
| description: Lightweight traffic analysis service for single intersection monitoring | ||
| version: 1.0.0 | ||
| paths: | ||
| "/api/v1/traffic/current": | ||
| get: | ||
| summary: Get Current Traffic Intelligence | ||
| description: |- | ||
| Get current traffic intelligence data for the intersection. | ||
|
|
||
| Returns complete traffic intelligence response matching data.json schema | ||
| with weather data and VLM analysis. | ||
| operationId: get_current_traffic_intelligence_api_v1_traffic_current_get | ||
| parameters: | ||
| - name: images | ||
| in: query | ||
| required: false | ||
| schema: | ||
| type: boolean | ||
| default: true | ||
| description: Include camera images in response | ||
| title: Images | ||
| description: Include camera images in response | ||
| responses: | ||
| '200': | ||
| description: Successful Response | ||
| content: | ||
| application/json: | ||
| schema: | ||
madhuri-rai07 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| type: object | ||
| title: Response Get Current Traffic Intelligence Api V1 Traffic Current | ||
| Get | ||
| '404': | ||
| description: No traffic data available | ||
| '422': | ||
| description: Validation Error | ||
| content: | ||
| application/json: | ||
| schema: | ||
| "$ref": "#/components/schemas/HTTPValidationError" | ||
| "/health": | ||
| get: | ||
| summary: Health Check | ||
| description: Health check endpoint. | ||
| operationId: health_check_health_get | ||
| responses: | ||
| '200': | ||
| description: Successful Response | ||
| content: | ||
| application/json: | ||
| schema: {} | ||
| components: | ||
| schemas: | ||
| HTTPValidationError: | ||
| properties: | ||
| detail: | ||
| items: | ||
| "$ref": "#/components/schemas/ValidationError" | ||
| type: array | ||
| title: Detail | ||
| type: object | ||
| title: HTTPValidationError | ||
| ValidationError: | ||
| properties: | ||
| loc: | ||
| items: | ||
| anyOf: | ||
| - type: string | ||
| - type: integer | ||
| type: array | ||
| title: Location | ||
| msg: | ||
| type: string | ||
| title: Message | ||
| type: | ||
| type: string | ||
| title: Error Type | ||
| type: object | ||
| required: | ||
| - loc | ||
| - msg | ||
| - type | ||
| title: ValidationError | ||
| WeatherType: | ||
| type: string | ||
| enum: | ||
| - clear | ||
| title: WeatherType | ||
| description: Weather condition | ||
6 changes: 6 additions & 0 deletions
6
metro-ai-suite/smart-traffic-intersection-agent/docs/user-guide/api-reference.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # API Reference | ||
| **Version: 1.0.0** | ||
|
|
||
| ```{eval-rst} | ||
| .. swagger-plugin:: api-docs/openapi.yaml | ||
| ``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.