Skip to content

Commit e26bec1

Browse files
dnoliveroommensy
andauthored
Refactor Gradio Application (#328)
* Show Live Telemetry while Benchmark is running * Use Coming Soon for pipelines under development * Use Intel Digital Library Images for Thumbnails * Update SmartNVR thumbnail to Asset ID a1187747 * Update Transportation2 thumbnail to Asset ID a1427620 * Add Pipeline information on Run tab * Suppress warning and logs * Apply black format to python files Co-authored-by: oommensy <[email protected]>
1 parent b9df29c commit e26bec1

8 files changed

Lines changed: 621 additions & 358 deletions

File tree

tools/visual-pipeline-and-platform-evaluation-tool/app.py

Lines changed: 587 additions & 340 deletions
Large diffs are not rendered by default.

tools/visual-pipeline-and-platform-evaluation-tool/compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ services:
3333
environment:
3434
- MODELS_PATH=/output/
3535
user: root
36-
command: bash -xc '
36+
command: bash -c '
3737
cp /tmp/models.sh . &&
3838
chmod +x models.sh &&
39-
bash -cx ./models.sh &&
39+
bash -c ./models.sh &&
4040
tail -f /dev/null
4141
'
4242
restart: on-failure:5

tools/visual-pipeline-and-platform-evaluation-tool/models.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#/bin/bash
22

3-
set -euxo pipefail
3+
set -euo pipefail
44

55
# Remove healthcheck.txt if it exists
66
rm -f healthcheck.txt

tools/visual-pipeline-and-platform-evaluation-tool/pipelines/smartnvr/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ definition: >
33
The Smart Network Video Recorder (NVR) Proxy Pipeline builds on top of the
44
Simple NVR Proxy Pipeline to add support for video analytics on a subset of input channels.
55
metadata:
6-
classname: SmartNVRPipeline
6+
classname: SmartNVRPipeline
7+
enabled: true
3.16 MB
Loading

tools/visual-pipeline-and-platform-evaluation-tool/pipelines/transportation2/config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ definition: >
33
The Transportation Proxy Pipeline 2 (D-C) collects road data to understand road usage,
44
and collects additional data for tracking vehicles.
55
metadata:
6-
classname: Transportation2Pipeline
6+
classname: Transportation2Pipeline
7+
enabled: false
966 KB
Loading

tools/visual-pipeline-and-platform-evaluation-tool/utils.py

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,7 @@
1818

1919

2020
def prepare_video_and_constants(
21-
input_video_player,
22-
object_detection_model,
23-
object_detection_device,
24-
object_detection_batch_size,
25-
object_detection_nireq,
26-
object_detection_inference_interval,
27-
object_classification_model,
28-
object_classification_device,
29-
object_classification_batch_size,
30-
object_classification_nireq,
31-
object_classification_inference_interval,
32-
object_classification_reclassify_interval,
21+
**kwargs: dict[str, any],
3322
):
3423
"""
3524
Prepares the video output path, constants, and parameter grid for the pipeline.
@@ -42,6 +31,27 @@ def prepare_video_and_constants(
4231
Returns:
4332
tuple: A tuple containing video_output_path, constants, and param_grid.
4433
"""
34+
35+
# Collect parameters from kwargs
36+
input_video_player = kwargs.get("input_video_player", "")
37+
object_detection_model = kwargs.get("object_detection_model", "")
38+
object_detection_device = kwargs.get("object_detection_device", "")
39+
object_detection_batch_size = kwargs.get("object_detection_batch_size", 1)
40+
object_detection_inference_interval = kwargs.get(
41+
"object_detection_inference_interval", 0.0
42+
)
43+
object_detection_nireq = kwargs.get("object_detection_nireq", 1)
44+
object_classification_model = kwargs.get("object_classification_model", "")
45+
object_classification_device = kwargs.get("object_classification_device", "")
46+
object_classification_batch_size = kwargs.get("object_classification_batch_size", 1)
47+
object_classification_inference_interval = kwargs.get(
48+
"object_classification_inference_interval", 0.0
49+
)
50+
object_classification_reclassify_interval = kwargs.get(
51+
"object_classification_reclassify_interval", 0.0
52+
)
53+
object_classification_nireq = kwargs.get("object_classification_nireq", 1)
54+
4555
random_string = "".join(random.choices(string.ascii_lowercase + string.digits, k=6))
4656
video_output_path = input_video_player.replace(
4757
".mp4", f"-output-{random_string}.mp4"
@@ -52,6 +62,10 @@ def prepare_video_and_constants(
5262
if os.path.exists(video_output_path):
5363
os.remove(video_output_path)
5464

65+
# Reset the FPS file
66+
with open("/home/dlstreamer/vippet/.collector-signals/fps.txt", "w") as f:
67+
f.write(f"0.0\n")
68+
5569
param_grid = {
5670
"object_detection_device": object_detection_device.split(", "),
5771
"object_detection_batch_size": [object_detection_batch_size],
@@ -202,7 +216,7 @@ def run_pipeline_and_extract_metrics(
202216
)
203217

204218
# Log the command
205-
logger.info(f"Pipeline Command: {_pipeline}")
219+
logger.debug(f"Pipeline Command: {_pipeline}")
206220

207221
try:
208222
# Set the environment variable to enable all drivers

0 commit comments

Comments
 (0)