Skip to content
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

Multi cam #615

Merged
merged 4 commits into from
Aug 23, 2024
Merged
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: 1 addition & 1 deletion performance-tools
102 changes: 95 additions & 7 deletions src/pipeline-server/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,112 @@
"name": "yolov5_full",
"source": "gstreamer",
"queue_maxsize": 50,
"pipeline": "{auto_source} ! decodebin ! videoscale ! video/x-raw,width=1280,height=720 ! gvadetect model={models[object_detection][yolov5s][FP16-INT8][network]} name=detection ! gvatrack name=tracking tracking-type=zero-term-imageless ! gvaclassify model={models[object_classification][efficientnet-b0][network]} inference-region=roi-list name=classification ! gvapython class=ObjectFilter module=/home/pipeline-server/extensions/tracked_object_filter.py name=tracked_object_filter ! gvadetect model={models[text_detection][horizontal-text-detection-0002][network]} name=text_detection inference-region=roi-list ! gvainference model={models[text_recognition][text-recognition-0012][network]} name=text_recognition inference-region=roi-list object-class=text ! gvapython class=OCR module=/home/pipeline-server/gvapython/OCR_post_processing_0012.py name=ocr_postprocess ! gvapython name=barcode class=BarcodeDetection module=/home/pipeline-server/gvapython/barcode_nv12_to_gray.py ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination ! appsink name=appsink",
"pipeline": "{auto_source} ! decodebin ! videoscale ! video/x-raw,width=1280,height=720 ! gvadetect model={models[object_detection][yolov5s][FP16-INT8][network]} name=detection ! gvaclassify model={models[object_classification][efficientnet-b0][network]} inference-region=roi-list name=classification ! gvapython class=ObjectFilter module=/home/pipeline-server/extensions/tracked_object_filter.py name=tracked_object_filter ! gvadetect model={models[text_detection][horizontal-text-detection-0002][network]} name=text_detection inference-region=roi-list ! gvapython class=OCR module=/home/pipeline-server/gvapython/OCR_post_processing_0012.py name=ocr_postprocess ! gvapython name=barcode class=BarcodeDetection module=/home/pipeline-server/gvapython/barcode_nv12_to_gray.py ! gvametaconvert name=metaconvert add-empty-results=true ! gvametapublish name=destination ! appsink name=appsink",
"description": "Object detection with yolov5s",
"parameters": {
"type": "object",
"properties": {
"detection-properties": {
"detection": {
"type": "object",
"element": {
"name": "detection",
"format": "element-properties"
}
},
"detection-device": {
"text-detection": {
"type": "object",
"element": {
"name": "detection",
"property": "device"
"name": "text_detection",
"format": "element-properties"
}
},
"text-recognition": {
"type": "object",
"element": {
"name": "text_recognition",
"format": "element-properties"
}
},
"barcode-properties": {
"element": {
"name": "barcode",
"property": "kwarg",
"format": "json"
},
"type": "string",
"default": "{env[DETECTION_DEVICE]}"
"type": "object",
"properties": {
"disable": {
"type": "boolean"
},
"decode_type": {
"type": "string"
}
}
},
"OCR-properties": {
"element": {
"name": "ocr_postprocess",
"property": "kwarg",
"format": "json"
},
"type": "object",
"properties": {
"threshold": {
"type": "number"
}
},
"default": {
"threshold": 0.5
}
},
"classification": {
"type": "object",
"element": {
"name": "classification",
"format": "element-properties"
}
},
"classification-filter": {
"element": {
"name": "classification_filter",
"format": "json",
"property": "kwarg"
},
"type": "object",
"properties": {
"object_filter": {
"type": "array"
}
}
},
"classification-filter-num-objects": {
"element": {
"name": "classification_filter_num_objects",
"format": "json",
"property": "kwarg"
},
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"min_objects": {
"type": "integer"
},
"max_objects": {
"type": "integer"
},
"fake_object_width": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"fake_object_height": {
"type": "number",
"minimum": 0,
"maximum": 1
}
}
}
}
},
Expand Down
42 changes: 38 additions & 4 deletions src/pipeline-server/docker-compose.pipeline-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,40 @@ services:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media
networks:
checkout-network: {}
camera-simulator1:
image: jrottenberg/ffmpeg:4.1-alpine
container_name: camera-simulator1
entrypoint: ["/bin/sh","-c"]
command:
- |
if [ ! -f /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 ]; then
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
fi
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://camera-simulator:8554/camera_1
depends_on:
- camera-simulator
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media
networks:
checkout-network: {}
camera-simulator2:
image: jrottenberg/ffmpeg:4.1-alpine
container_name: camera-simulator2
entrypoint: ["/bin/sh","-c"]
command:
- |
if [ ! -f /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 ]; then
mkdir -p /home/pipeline-server/sample-media
wget -O /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 https://www.pexels.com/download/video/4465029
fi
ffmpeg -nostdin -re -stream_loop -1 -i /home/pipeline-server/sample-media/coca-cola-4465029-1920-15-bench.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://camera-simulator:8554/camera_2
depends_on:
- camera-simulator
volumes:
- ${RETAIL_USE_CASE_ROOT:-..}/performance-tools/sample-media:/home/pipeline-server/sample-media
networks:
checkout-network: {}

evamclient0:
container_name: evam_0
Expand Down Expand Up @@ -68,7 +102,7 @@ services:

evamclient1:
container_name: evam_1
image: amr-registry.caas.intel.com/nex-microservices/intel/edge_video_analytics_microservice@sha256:5588f0488d908bc07daab9555c2776eb4a9bead78f43dde2eec452b610a534b4
image: bmcginn/cv-workshop:2.1
ports:
- 8556:8554
- 8071:8080
Expand All @@ -94,7 +128,7 @@ services:

evamclient2:
container_name: evam_2
image: amr-registry.caas.intel.com/nex-microservices/intel/edge_video_analytics_microservice@sha256:5588f0488d908bc07daab9555c2776eb4a9bead78f43dde2eec452b610a534b4
image: bmcginn/cv-workshop:2.1
ports:
- 8557:8554
- 8072:8080
Expand Down Expand Up @@ -196,7 +230,7 @@ services:
checkout-network: {}

multimodal-data-visualization:
image: amr-registry.caas.intel.com/nex-microservices/intel/multimodal-data-visualization@sha256:b786f7c5cd82cda0cb39c912748a667aef8fc03ed8adf196ca44b84c3cd3a69b
image: mr-registry.caas.intel.com/nex-microservices/intel/multimodal-data-visualization@sha256:b786f7c5cd82cda0cb39c912748a667aef8fc03ed8adf196ca44b84c3cd3a69b
container_name: multimodal-data-visualization
ipc: "none"
security_opt:
Expand All @@ -214,7 +248,7 @@ services:
max_attempts: 5
volumes:
- "vol_temp_grafana:/tmp"
- ${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/postman/eva:/app/eva
- ${RETAIL_USE_CASE_ROOT:-..}/src/pipeline-server/grafana:/app/eva
environment:
HOST_IP: evam_0
MODE: "EVA"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"overrides": []
},
"gridPos": {
"h": 3,
"h": 7,
"w": 12,
"x": 0,
"y": 1
Expand Down Expand Up @@ -302,142 +302,6 @@
"alignLevel": null
}
},
{
"datasource": "Infinity",
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 1,
"mappings": [],
"max": 50,
"min": 1,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "#007dc3",
"value": 8
},
{
"color": "#007dc3",
"value": 12
},
{
"color": "green",
"value": 30
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 12,
"x": 0,
"y": 4
},
"id": 15,
"interval": "5s",
"links": [
{
"title": "",
"url": "http://evam_0:8080/pipelines/status"
}
],
"maxDataPoints": 200,
"options": {
"displayMode": "lcd",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "/^FPS \\(avg\\)$/",
"values": true
},
"showUnfilled": true,
"text": {}
},
"pluginVersion": "8.1.5",
"targets": [
{
"columns": [
{
"selector": "avg_fps",
"text": "FPS (avg)",
"type": "number"
},
{
"selector": "id",
"text": "Pipeline",
"type": "string"
},
{
"selector": "state",
"text": "Status",
"type": "string"
},
{
"selector": "elapsed_time",
"text": "Elapsed",
"type": "number"
}
],
"data": "",
"filters": [
{
"field": "Status",
"operator": "notin",
"value": [
"QUEUED,RUNNING"
]
},
{
"field": "Elapsed",
"operator": ">",
"value": [
"0"
]
},
{
"field": "FPS (avg)",
"operator": ">",
"value": [
"0"
]
}
],
"format": "table",
"global_query_id": "",
"json_options": {
"columnar": false,
"root_is_not_array": false
},
"refId": "A",
"root_selector": "",
"source": "url",
"type": "json",
"url": "http://evam_0:8080/pipelines/status",
"url_options": {
"data": "",
"method": "GET"
}
}
],
"timeFrom": "now-5s",
"timeShift": null,
"title": "Completed Pipeline Streams",
"type": "bargauge"
},
{
"collapsed": false,
"datasource": null,
Expand Down
18 changes: 18 additions & 0 deletions src/pipeline-server/postman/env.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@
"value": "yolov5_effnet",
"type": "default",
"enabled": true
},
{
"key": "camera_0",
"value": "rtsp://camera-simulator:8554/camera_0",
"type": "default",
"enabled": true
},
{
"key": "camera_1",
"value": "rtsp://camera-simulator:8554/camera_1",
"type": "default",
"enabled": true
},
{
"key": "camera_2",
"value": "rtsp://camera-simulator:8554/camera_2",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
Expand Down
Loading
Loading