Skip to content

Commit 37bc045

Browse files
authored
[ViPPET] Move vippet to a separate directory (open-edge-platform#1039)
1 parent e69e157 commit 37bc045

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+318
-296
lines changed

tools/visual-pipeline-and-platform-evaluation-tool/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ VENV_DIR := .venv
2828
# This value is overridden by setup_env.sh in relevant targets.
2929
export RENDER_GROUP_ID := 1000
3030

31-
$(VENV_DIR): requirements.txt ## Create Python venv
31+
$(VENV_DIR): $(PROJECT_NAME)/requirements.txt ## Create Python venv
3232
python3 -m venv $@ ;\
3333
set +u; . ./$@/bin/activate; set -u ;\
3434
python -m pip install --upgrade pip ;\
35-
python -m pip install -r requirements-dev.txt
35+
python -m pip install -r $(PROJECT_NAME)/requirements-dev.txt
3636

3737
all: lint build run test ## Run lint, build, run and test
3838

@@ -100,6 +100,7 @@ test: $(VENV_DIR) ## Run tests and generate coverage report
100100
# Run tests using the vippet-cpu container (tests are device agnostic)
101101
DOCKER_TAG=$(VERSION) docker compose run --rm --no-deps --volume $(PROJECT_DIR):/home/dlstreamer/vippet \
102102
vippet-cpu bash -c "\
103+
cd $(PROJECT_NAME) && \
103104
python -m coverage run --source=./ --data-file=/tmp/.vippet-coverage -m unittest discover -v -s ./tests -p '*_test.py' && \
104105
python -m coverage report --data-file=/tmp/.vippet-coverage --omit=*/config-3.py,*/config.py,*_test.py"
105106

@@ -136,7 +137,7 @@ stop: ## Stop the docker compose services
136137
DOCKER_TAG=$(VERSION) docker compose down models collector videogenerator $$VIPPET_SERVICE
137138

138139
clean: ## Clean all build artifacts
139-
rm -rf .collector-signals/ models/output/ videos/
140+
rm -rf $(PROJECT_NAME)/.collector-signals/ models/output/ videos/
140141

141142
help: ## Print help for each target
142143
@echo ViPPET make targets

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@ services:
22
vippet-gpu:
33
command: tail -f /dev/null
44
volumes:
5-
- ./:/home/dlstreamer/vippet
5+
- ./vippet:/home/dlstreamer/vippet
6+
- ./.venv:/home/dlstreamer/vippet/.venv
7+
- ./models/supported_models.lst:/home/dlstreamer/vippet/supported_models.lst
8+
- ./models/output:/home/dlstreamer/vippet/models
69
vippet-cpu:
710
command: tail -f /dev/null
811
volumes:
9-
- ./:/home/dlstreamer/vippet
12+
- ./vippet:/home/dlstreamer/vippet
13+
- ./.venv:/home/dlstreamer/vippet/.venv
14+
- ./models/supported_models.lst:/home/dlstreamer/vippet/supported_models.lst
15+
- ./models/output:/home/dlstreamer/vippet/models
1016
vippet-npu:
1117
command: tail -f /dev/null
1218
volumes:
13-
- ./:/home/dlstreamer/vippet
19+
- ./vippet:/home/dlstreamer/vippet
20+
- ./.venv:/home/dlstreamer/vippet/.venv
21+
- ./models/supported_models.lst:/home/dlstreamer/vippet/supported_models.lst
22+
- ./models/output:/home/dlstreamer/vippet/models

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ x-vippet: &vippet
22
image: docker.io/intel/vippet-app:${DOCKER_TAG}
33
build:
44
context: .
5-
dockerfile: Dockerfile.vippet
5+
dockerfile: vippet/Dockerfile
66
args:
77
http_proxy:
88
https_proxy:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"executionEnvironments": [
3+
{
4+
"root": "vippet"
5+
},
6+
{
7+
"root": "collector"
8+
},
9+
{
10+
"root": "video_generator"
11+
}
12+
]
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,56 @@
1-
# Copyright (C) 2025 Intel Corporation
2-
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
9-
# Unless required by applicable law or agreed to in writing,
10-
# software distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions
13-
# and limitations under the License.
14-
15-
# SPDX-License-Identifier: Apache-2.0
16-
17-
FROM intel/dlstreamer:2025.1.2-ubuntu24
18-
19-
USER root
20-
21-
RUN apt-get update && apt-get install --yes --no-install-recommends gstreamer1.0-plugins-ugly
22-
23-
USER dlstreamer
24-
25-
ENV GST_PLUGIN_PATH=$GST_PLUGIN_PATH/usr/lib/x86_64-linux-gnu/gstreamer-1.0/
26-
27-
WORKDIR /home/dlstreamer/vippet
28-
29-
ENV VIRTUAL_ENV=/home/dlstreamer/vippet/.venv
30-
RUN python3 -m venv $VIRTUAL_ENV
31-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
32-
33-
COPY requirements.txt /home/dlstreamer/vippet/requirements.txt
34-
35-
RUN \
36-
pip3 install --no-cache-dir --upgrade pip && \
37-
pip3 install --no-cache-dir -r requirements.txt
38-
39-
COPY --chown=dlstreamer:dlstreamer \
40-
app.py \
41-
app.css \
42-
benchmark.py \
43-
chart.py \
44-
device.py \
45-
explore.py \
46-
gstpipeline.py \
47-
models/supported_models.lst \
48-
models.py \
49-
optimize.py \
50-
utils.py \
51-
home.py \
52-
pipelines/pipeline_page.py \
53-
/home/dlstreamer/vippet/
54-
55-
COPY --chown=dlstreamer:dlstreamer pipelines/ /home/dlstreamer/vippet/pipelines
56-
57-
CMD ["/bin/bash", "-c", "python app.py"]
1+
# Copyright (C) 2025 Intel Corporation
2+
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
9+
# Unless required by applicable law or agreed to in writing,
10+
# software distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions
13+
# and limitations under the License.
14+
15+
# SPDX-License-Identifier: Apache-2.0
16+
17+
FROM intel/dlstreamer:2025.1.2-ubuntu24
18+
19+
USER root
20+
21+
RUN apt-get update && apt-get install --yes --no-install-recommends gstreamer1.0-plugins-ugly
22+
23+
USER dlstreamer
24+
25+
ENV GST_PLUGIN_PATH=$GST_PLUGIN_PATH/usr/lib/x86_64-linux-gnu/gstreamer-1.0/
26+
27+
WORKDIR /home/dlstreamer/vippet
28+
29+
ENV VIRTUAL_ENV=/home/dlstreamer/vippet/.venv
30+
RUN python3 -m venv $VIRTUAL_ENV
31+
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
32+
33+
COPY vippet/requirements.txt /home/dlstreamer/vippet/requirements.txt
34+
35+
RUN \
36+
pip3 install --no-cache-dir --upgrade pip && \
37+
pip3 install --no-cache-dir -r requirements.txt
38+
39+
COPY --chown=dlstreamer:dlstreamer \
40+
vippet/app.py \
41+
vippet/app.css \
42+
vippet/benchmark.py \
43+
vippet/chart.py \
44+
vippet/device.py \
45+
vippet/explore.py \
46+
vippet/gstpipeline.py \
47+
models/supported_models.lst \
48+
vippet/models.py \
49+
vippet/optimize.py \
50+
vippet/utils.py \
51+
vippet/home.py \
52+
/home/dlstreamer/vippet/
53+
54+
COPY --chown=dlstreamer:dlstreamer vippet/pipelines/ /home/dlstreamer/vippet/pipelines
55+
56+
CMD ["/bin/bash", "-c", "python app.py"]
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,61 @@
1-
import os
2-
from typing import List
3-
4-
import gradio as gr
5-
6-
from gstpipeline import PipelineLoader
7-
from pipelines.pipeline_page import Pipeline
8-
import home
9-
10-
11-
def create_interface() -> gr.Blocks:
12-
with open(os.path.join(os.path.dirname(__file__), "app.css")) as f:
13-
css_code = f.read()
14-
15-
theme = gr.themes.Default( # pyright: ignore[reportPrivateImportUsage]
16-
primary_hue="blue",
17-
font=[gr.themes.GoogleFont("Montserrat"), "ui-sans-serif", "sans-serif"], # pyright: ignore[reportPrivateImportUsage]
18-
)
19-
20-
title: str = "Visual Pipeline and Platform Evaluation Tool"
21-
22-
pipelines: List[Pipeline] = []
23-
for id, pipeline_dir in enumerate(PipelineLoader.list(), start=1):
24-
pipelines.append(Pipeline(id, pipeline_dir))
25-
26-
with gr.Blocks(theme=theme, css=css_code, title=title) as vippet:
27-
# Header
28-
gr.HTML(
29-
"<div class='spark-header'>"
30-
" <div class='spark-header-line'></div>"
31-
" <img src='https://www.intel.com/content/dam/logos/intel-header-logo.svg' class='spark-logo'></img>"
32-
" <div class='spark-title'>Visual Pipeline and Platform Evaluation Tool</div>"
33-
"</div>"
34-
)
35-
36-
with gr.Tabs() as tabs:
37-
home.tab("Home", 0, pipelines, tabs)
38-
39-
for pipeline in pipelines:
40-
if pipeline.enabled:
41-
with gr.Tab(label=pipeline.config["name"], id=pipeline.id):
42-
pipeline.tab()
43-
44-
# Footer
45-
gr.HTML(
46-
"<div class='spark-footer'>"
47-
" <div class='spark-footer-info'>"
48-
" ©2025 Intel Corporation | Terms of Use | Cookies | Privacy"
49-
" </div>"
50-
"</div>"
51-
)
52-
53-
return vippet
54-
55-
56-
if __name__ == "__main__":
57-
vippet = create_interface()
58-
vippet.launch(
59-
server_name="0.0.0.0",
60-
server_port=7860,
61-
)
1+
import os
2+
from typing import List
3+
4+
import gradio as gr
5+
6+
from gstpipeline import PipelineLoader
7+
from pipelines.pipeline_page import Pipeline
8+
import home
9+
10+
11+
def create_interface() -> gr.Blocks:
12+
with open(os.path.join(os.path.dirname(__file__), "app.css")) as f:
13+
css_code = f.read()
14+
15+
theme = gr.themes.Default( # pyright: ignore[reportPrivateImportUsage]
16+
primary_hue="blue",
17+
font=[gr.themes.GoogleFont("Montserrat"), "ui-sans-serif", "sans-serif"], # pyright: ignore[reportPrivateImportUsage]
18+
)
19+
20+
title: str = "Visual Pipeline and Platform Evaluation Tool"
21+
22+
pipelines: List[Pipeline] = []
23+
for id, pipeline_dir in enumerate(PipelineLoader.list(), start=1):
24+
pipelines.append(Pipeline(id, pipeline_dir))
25+
26+
with gr.Blocks(theme=theme, css=css_code, title=title) as vippet:
27+
# Header
28+
gr.HTML(
29+
"<div class='spark-header'>"
30+
" <div class='spark-header-line'></div>"
31+
" <img src='https://www.intel.com/content/dam/logos/intel-header-logo.svg' class='spark-logo'></img>"
32+
" <div class='spark-title'>Visual Pipeline and Platform Evaluation Tool</div>"
33+
"</div>"
34+
)
35+
36+
with gr.Tabs() as tabs:
37+
home.tab("Home", 0, pipelines, tabs)
38+
39+
for pipeline in pipelines:
40+
if pipeline.enabled:
41+
with gr.Tab(label=pipeline.config["name"], id=pipeline.id):
42+
pipeline.tab()
43+
44+
# Footer
45+
gr.HTML(
46+
"<div class='spark-footer'>"
47+
" <div class='spark-footer-info'>"
48+
" ©2025 Intel Corporation | Terms of Use | Cookies | Privacy"
49+
" </div>"
50+
"</div>"
51+
)
52+
53+
return vippet
54+
55+
56+
if __name__ == "__main__":
57+
vippet = create_interface()
58+
vippet.launch(
59+
server_name="0.0.0.0",
60+
server_port=7860,
61+
)

0 commit comments

Comments
 (0)