diff --git a/performance-tools b/performance-tools index e804aae0..197209f8 160000 --- a/performance-tools +++ b/performance-tools @@ -1 +1 @@ -Subproject commit e804aae0a9b13043ed96c47023f960cc635e7081 +Subproject commit 197209f8f7bee712df5728d7cfae1605a3820d07 diff --git a/src/pipeline-server/config.json b/src/pipeline-server/config.json index c16b3139..a63ce50b 100644 --- a/src/pipeline-server/config.json +++ b/src/pipeline-server/config.json @@ -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 + } + } } } }, diff --git a/src/pipeline-server/docker-compose.pipeline-server.yml b/src/pipeline-server/docker-compose.pipeline-server.yml index f729cab6..ca59bfa1 100644 --- a/src/pipeline-server/docker-compose.pipeline-server.yml +++ b/src/pipeline-server/docker-compose.pipeline-server.yml @@ -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 @@ -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 @@ -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 @@ -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: @@ -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" diff --git a/src/pipeline-server/postman/eva/dashboard.json b/src/pipeline-server/grafana/dashboard.json similarity index 73% rename from src/pipeline-server/postman/eva/dashboard.json rename to src/pipeline-server/grafana/dashboard.json index 987187bc..b49350e1 100644 --- a/src/pipeline-server/postman/eva/dashboard.json +++ b/src/pipeline-server/grafana/dashboard.json @@ -80,7 +80,7 @@ "overrides": [] }, "gridPos": { - "h": 3, + "h": 7, "w": 12, "x": 0, "y": 1 @@ -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, diff --git a/src/pipeline-server/postman/eva/dashboards.yml b/src/pipeline-server/grafana/dashboards.yml similarity index 100% rename from src/pipeline-server/postman/eva/dashboards.yml rename to src/pipeline-server/grafana/dashboards.yml diff --git a/src/pipeline-server/postman/eva/datasources.yml b/src/pipeline-server/grafana/datasources.yml similarity index 100% rename from src/pipeline-server/postman/eva/datasources.yml rename to src/pipeline-server/grafana/datasources.yml diff --git a/src/pipeline-server/postman/eva/grafana.ini b/src/pipeline-server/grafana/grafana.ini similarity index 100% rename from src/pipeline-server/postman/eva/grafana.ini rename to src/pipeline-server/grafana/grafana.ini diff --git a/src/pipeline-server/postman/env.json b/src/pipeline-server/postman/env.json index 9ea3b0e6..1be7ef77 100644 --- a/src/pipeline-server/postman/env.json +++ b/src/pipeline-server/postman/env.json @@ -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", diff --git a/src/pipeline-server/postman/pipeline.json b/src/pipeline-server/postman/pipeline.json index 0afb1fbe..076f57de 100644 --- a/src/pipeline-server/postman/pipeline.json +++ b/src/pipeline-server/postman/pipeline.json @@ -46,7 +46,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"source\": {\n \"uri\": \"rtsp://camera-simulator:8554/camera_0\",\n \"type\": \"uri\"\n },\n \"destination\": {\n \"metadata\": {\n \"type\": \"mqtt\",\n \"host\": \"mqtt-broker:1883\",\n \"topic\": \"AnalyticsData0\",\n \"timeout\": 1000\n },\n \"frame\": {\n \"type\": \"webrtc\",\n \"peer-id\": \"Automated_Self_Checkout_Results\"\n }\n },\n \"parameters\": {\n \"detection-device\": \"CPU\"\n }\n }", + "raw": "{\n \"source\": {\n \"uri\": \"{{camera_0}}\",\n \"type\": \"uri\"\n },\n \"destination\": {\n \"metadata\": {\n \"type\": \"mqtt\",\n \"host\": \"mqtt-broker:1883\",\n \"topic\": \"AnalyticsData0\",\n \"timeout\": 1000\n },\n \"frame\": {\n \"type\": \"webrtc\",\n \"peer-id\": \"Automated_Self_Checkout_Results0\"\n }\n },\n \"parameters\": {\n \"detection-device\": \"CPU\"\n }\n }", "options": { "raw": { "language": "json" @@ -108,7 +108,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"source\": {\n \"uri\": \"rtsp://camera-simulator:8554/camera_0\",\n \"type\": \"uri\"\n },\n \"destination\": {\n \"metadata\": {\n \"type\": \"mqtt\",\n \"host\": \"mqtt-broker:1883\",\n \"topic\": \"AnalyticsData1\",\n \"timeout\": 1000\n }\n },\n \"parameters\": {\n \"detection-device\": \"CPU\"\n }\n }", + "raw": "{\n \"source\": {\n \"uri\": \"{{camera_1}}\",\n \"type\": \"uri\"\n },\n \"destination\": {\n \"metadata\": {\n \"type\": \"mqtt\",\n \"host\": \"mqtt-broker:1883\",\n \"topic\": \"AnalyticsData1\",\n \"timeout\": 1000\n },\n \"frame\": {\n \"type\": \"webrtc\",\n \"peer-id\": \"Automated_Self_Checkout_Results1\"\n }\n },\n \"parameters\": {\n \"detection-device\": \"CPU\"\n }\n }", "options": { "raw": { "language": "json" @@ -116,9 +116,9 @@ } }, "url": { - "raw": "evam_1:8080/pipelines/detection/{{pipeline}}", + "raw": "evam_0:8080/pipelines/detection/{{pipeline}}", "host": [ - "evam_1" + "evam_0" ], "port": "8080", "path": [ @@ -170,7 +170,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"source\": {\n \"uri\": \"rtsp://camera-simulator:8554/camera_0\",\n \"type\": \"uri\"\n },\n \"destination\": {\n \"metadata\": {\n \"type\": \"mqtt\",\n \"host\": \"mqtt-broker:1883\",\n \"topic\": \"AnalyticsData2\",\n \"timeout\": 1000\n }\n },\n \"parameters\": {\n \"detection-device\": \"CPU\"\n }\n }", + "raw": "{\n \"source\": {\n \"uri\": \"{{camera_2}}\",\n \"type\": \"uri\"\n },\n \"destination\": {\n \"metadata\": {\n \"type\": \"mqtt\",\n \"host\": \"mqtt-broker:1883\",\n \"topic\": \"AnalyticsData2\",\n \"timeout\": 1000\n },\n \"frame\": {\n \"type\": \"webrtc\",\n \"peer-id\": \"Automated_Self_Checkout_Results2\"\n }\n },\n \"parameters\": {\n \"detection-device\": \"CPU\"\n }\n }", "options": { "raw": { "language": "json" @@ -178,9 +178,9 @@ } }, "url": { - "raw": "evam_2:8080/pipelines/detection/{{pipeline}}", + "raw": "evam_0:8080/pipelines/detection/{{pipeline}}", "host": [ - "evam_2" + "evam_0" ], "port": "8080", "path": [ diff --git a/src/pipeline-server/status.sh b/src/pipeline-server/status.sh index a0fccdd6..b9c3b151 100755 --- a/src/pipeline-server/status.sh +++ b/src/pipeline-server/status.sh @@ -11,8 +11,8 @@ do echo "----------------8080----------------" >> status_results.txt curl --location 'localhost:8080/pipelines/status' >> status_results.txt echo "----------------8081----------------" >> status_results.txt - curl --location 'localhost:8081/pipelines/status' >> status_results.txt + curl --location 'localhost:8071/pipelines/status' >> status_results.txt echo "----------------8082----------------" >> status_results.txt - curl --location 'localhost:8082/pipelines/status' >> status_results.txt + curl --location 'localhost:8072/pipelines/status' >> status_results.txt sleep 15 done