Skip to content

Commit d56e6f3

Browse files
ITEP-81114: Update set of models used in model downloader script (#1022)
1 parent 5c7b519 commit d56e6f3

File tree

9 files changed

+33
-133
lines changed

9 files changed

+33
-133
lines changed

docs/user-guide/other-topics/how-to-configure-dlstreamer-video-pipeline.md

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ Model chaining allows you to combine multiple AI models in a single pipeline to
3030

3131
##### Prerequisites
3232

33-
By default, only a limited number of models is downloaded during helm chart installation, which limits the possibilities of model chaining. To enable the full set of models:
33+
By default, only a limited number of models is downloaded during helm chart installation, which limits the possibilities of model chaining. To enable all models:
3434

35-
1. Set `initModels.modelType=all` in `kubernetes/scenescape-chart/values.yaml`.
36-
2. Configure desired model precisions (e.g., `initModels.modelPrecisions=FP16`) in `kubernetes/scenescape-chart/values.yaml`.
37-
3. (Re)deploy Intel® SceneScape to download the additional models.
35+
1. Configure desired model precisions (e.g., `initModels.modelPrecisions=FP16`) in `kubernetes/scenescape-chart/values.yaml`.
36+
2. (Re)deploy Intel® SceneScape to download the supported models.
3837

3938
##### Chaining Syntax
4039

@@ -50,28 +49,14 @@ By default, only a limited number of models is downloaded during helm chart inst
5049

5150
Use the following short names to refer to each model in the chain:
5251

53-
| Category | Full Model Name | Short Name | Description |
54-
| --------------------- | -------------------------------------------- | ----------- | ----------------------------------------- |
55-
| **Person Detection** | person-detection-retail-0013 | retail | General person detection |
56-
| | pedestrian-and-vehicle-detector-adas-0001 | pedveh | Pedestrian and vehicle detection |
57-
| **Person Analysis** | person-reidentification-retail-0277 | reid | Person re-identification |
58-
| | person-attributes-recognition-crossroad-0238 | personattr | Person attributes (age, gender, clothing) |
59-
| | age-gender-recognition-retail-0013 | agegender | Age and gender classification |
60-
| | human-pose-estimation-0001 | pose | Human pose estimation |
61-
| **Vehicle Detection** | vehicle-detection-0200 | veh0200 | Vehicle detection (newer model) |
62-
| | vehicle-detection-0201 | veh0201 | Vehicle detection (alternative) |
63-
| | vehicle-detection-0202 | veh0202 | Vehicle detection (alternative) |
64-
| | vehicle-detection-adas-0002 | vehadas | ADAS vehicle detection |
65-
| | person-vehicle-bike-detection-2000 | pvb2000 | Multi-class detection |
66-
| | person-vehicle-bike-detection-2001 | pvb2001 | Multi-class detection (v2) |
67-
| | person-vehicle-bike-detection-2002 | pvb2002 | Multi-class detection (v3) |
68-
| | person-vehicle-bike-detection-crossroad-0078 | pvbcross78 | Crossroad detection |
69-
| | person-vehicle-bike-detection-crossroad-1016 | pvbcross16 | Crossroad detection (v2) |
70-
| **Vehicle Analysis** | vehicle-attributes-recognition-barrier-0042 | vehattr | Vehicle attributes (color, type) |
71-
| | vehicle-license-plate-detection-barrier-0106 | platedetect | License plate detection |
72-
| **Text Analysis** | horizontal-text-detection-0001 | textdetect | Text detection |
73-
| | text-recognition-0012 | textrec | Text recognition |
74-
| | text-recognition-resnet-fc | textresnet | ResNet-based text recognition |
52+
| Category | Full Model Name | Short Name | Description |
53+
| -------------------- | -------------------------------------------- | ---------- | ----------------------------------------- |
54+
| **Person Detection** | person-detection-retail-0013 | retail | General person detection |
55+
| | person-vehicle-bike-detection-crossroad-1016 | pvbcross16 | Crossroad multi-class detection |
56+
| **Person Analysis** | person-reidentification-retail-0277 | reid | Person re-identification |
57+
| | person-attributes-recognition-crossroad-0238 | personattr | Person attributes (age, gender, clothing) |
58+
| | age-gender-recognition-retail-0013 | agegender | Age and gender classification |
59+
| **Vehicle Analysis** | vehicle-attributes-recognition-barrier-0042 | vehattr | Vehicle attributes (color, type) |
7560

7661
##### Common Chaining Patterns
7762

@@ -93,23 +78,20 @@ retail=GPU+agegender=GPU
9378

9479
```
9580
# Vehicle detection with re-identification
96-
veh0200=GPU+reid=GPU
81+
pvbcross16=GPU+reid=GPU
9782
9883
# Vehicle detection with attributes
99-
veh0200+vehattr
100-
101-
# Vehicle detection with license plate detection
102-
veh0200+platedetect
84+
pvbcross16+vehattr
10385
```
10486

10587
**Multi-Class Detection:**
10688

10789
```
10890
# Detect people, vehicles, and bikes
109-
pvb2000=GPU
91+
pvbcross16=GPU
11092
11193
# Multi-class detection with re-identification
112-
pvb2000=GPU+reid=GPU
94+
pvbcross16=GPU+reid=GPU
11395
```
11496

11597
#### Advanced Configuration

kubernetes/scenescape-chart/templates/model-installer/job.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
{{- if .Values.hooks.enabled }}
5-
{{- if not (has .Values.initModels.modelType (list "default" "ocr" "all")) }}
6-
{{- fail "initModels.modelType must be one of: default, ocr, all" }}
7-
{{- end }}
85
{{- if not (kindIs "bool" .Values.initModels.modelProc) }}
96
{{- fail "initModels.modelProc must be a boolean (true or false)" }}
107
{{- end }}
@@ -45,8 +42,6 @@ spec:
4542
imagePullPolicy: {{ .Values.initModels.image.pullPolicy }}
4643
name: {{ .Release.Name }}-init-models-container
4744
env:
48-
- name: MODEL_TYPE
49-
value: "{{ .Values.initModels.modelType }}"
5045
- name: MODEL_PRECISIONS
5146
value: "{{ .Values.initModels.modelPrecisions }}"
5247
- name: MODEL_PROC

kubernetes/scenescape-chart/values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ initModels:
1717
name: python
1818
tag: 3.13-slim@sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419
1919
pullPolicy: IfNotPresent
20-
# Model type to download - MUST be one of: default, ocr, all
21-
modelType: default
2220
# Model precisions - comma-separated list of: FP32, FP16, INT8
2321
modelPrecisions: FP32
2422
modelProc: true

model_installer/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ install-omz-models: create-models-volume build-image
2828
; APPDIR=/workspace \
2929
; HOSTDIR=$$PWD \
3030
; IMAGE=$(IMAGE):latest \
31-
; MODELS=--$${MODELS:-default} \
3231
; PRECISIONS=$${PRECISIONS:-FP32} \
3332
; docker run --rm -v $$HOSTDIR:$$APPDIR:z \
3433
-v $${COMPOSE_PROJECT_NAME}_vol-models:/opt/intel/openvino/deployment_tools/intel_models \
@@ -39,7 +38,7 @@ install-omz-models: create-models-volume build-image
3938
-e MODEL_DIR=/opt/intel/openvino/deployment_tools/intel_models \
4039
-u $$UID \
4140
-l user=$$USER $$IMAGE \
42-
/workspace/model_installer/src/install-omz-models $$MODELS --precisions $$PRECISIONS --model_proc
41+
/workspace/model_installer/src/install-omz-models --precisions $$PRECISIONS --model_proc
4342
@echo "DONE ==> Installing Open Model Zoo models"
4443

4544
copy-config-files: create-models-volume

model_installer/src/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ The models and configuration files are downloaded into a models volume that is a
99

1010
## Configuration
1111

12-
Model installer can be configured to download a specific set of models using the following parameters:
12+
Model installer downloads the supported model set defined in `install-omz-models` (`_DEFAULT_MODELS`) and can be configured with the following parameters:
1313

14-
| Parameter | Allowed Values | Format | Description |
15-
| ------------ | ----------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16-
| `models` | `default`, `ocr`, `all` | Single value | Specifies which set of models to download. `default` includes person detection, re-identification, and pose estimation models. `ocr` includes text detection and recognition models. `all` downloads both default and OCR models. |
17-
| `precisions` | `FP32`, `FP16`, `INT8` | Comma-separated list | Model precision formats to download. Multiple precisions can be specified for the same model (e.g., `FP16,FP32`). The first one will be used as preferred when generating `model-config.json` |
14+
| Parameter | Allowed Values | Format | Description |
15+
| ------------ | ---------------------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16+
| `precisions` | `FP32`, `FP16`, `INT8` | Comma-separated list | Model precision formats to download. Multiple precisions can be specified for the same model (e.g., `FP16,FP32`). The first one will be used as preferred when generating `model-config.json` |
17+
| `model_proc` | `true`, `false` | Single value | When enabled, attempts to download model-proc JSON files for each supported model and precision. |
1818

19-
For Kubernetes deployment refer to the `initModels` section in [Helm chart values](../../kubernetes/scenescape-chart/values.yaml), for example use `--set initModels.modelType=all --set initModels.modelPrecisions=FP16,FP32` when installing the Helm chart.
19+
For Kubernetes deployment refer to the `initModels` section in [Helm chart values](../../kubernetes/scenescape-chart/values.yaml), for example use `--set initModels.modelPrecisions=FP16,FP32 --set initModels.modelProc=true` when installing the Helm chart.
2020

21-
For Docker deployment use `MODELS` and `PRECISIONS` environment variables when building, e.g.: `make install-models MODELS=all` or `make install-models MODELS=all PRECISIONS="FP16,FP8"`.
21+
For Docker deployment use `PRECISIONS` environment variable when building, e.g.: `make install-models` or `make install-models PRECISIONS="FP16,FP32"`.
2222

2323
## Models Volume Folder Structure
2424

model_installer/src/entrypoint-k8s.sh

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,8 @@ apt-get update && apt-get install -y --no-install-recommends wget && rm -rf /var
1111
pip install --no-cache-dir -r /workspace/requirements-runtime.txt
1212

1313
# Run the entrypoint script to download models
14-
echo "Starting model installation with MODEL_TYPE=${MODEL_TYPE}, PRECISIONS=${MODEL_PRECISIONS}, MODEL_PROC=${MODEL_PROC}"
15-
# Build arguments for install-omz-models
16-
ARGS=""
17-
case "${MODEL_TYPE}" in
18-
"default")
19-
ARGS="--default"
20-
;;
21-
"ocr")
22-
ARGS="--ocr"
23-
;;
24-
"all")
25-
ARGS="--all"
26-
;;
27-
*)
28-
echo "Unknown MODEL_TYPE: ${MODEL_TYPE}. Using default."
29-
ARGS="--default"
30-
;;
31-
esac
32-
ARGS="${ARGS} --precisions ${MODEL_PRECISIONS}"
14+
echo "Starting model installation with PRECISIONS=${MODEL_PRECISIONS}, MODEL_PROC=${MODEL_PROC}"
15+
ARGS="--precisions ${MODEL_PRECISIONS}"
3316
# Add model_proc flag if enabled
3417
if [ "${MODEL_PROC}" = "true" ]; then
3518
ARGS="${ARGS} --model_proc"
@@ -41,7 +24,7 @@ echo "Copying config files..."
4124
python /workspace/copy-config-files /workspace ${MODEL_DIR}
4225
echo "Model installation completed successfully"
4326
echo "Models installed in: ${MODEL_DIR}"
44-
ls -la "${MODEL_DIR}" || true``
27+
ls -la "${MODEL_DIR}" || true
4528

4629
if [ -d "/workspace/models-storage/models/" ]; then
4730
echo "Models downloaded successfully"

model_installer/src/generate_model_config.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,11 @@
2222
_MODEL_NAME_MAP = {
2323
# Intel models
2424
"age-gender-recognition-retail-0013": "agegender",
25-
"horizontal-text-detection-0001": "textdetect",
26-
"human-pose-estimation-0001": "pose",
27-
"pedestrian-and-vehicle-detector-adas-0001": "pedveh",
2825
"person-attributes-recognition-crossroad-0238": "personattr",
2926
"person-detection-retail-0013": "retail",
3027
"person-reidentification-retail-0277": "reid",
31-
"person-vehicle-bike-detection-2000": "pvb2000",
32-
"person-vehicle-bike-detection-2001": "pvb2001",
33-
"person-vehicle-bike-detection-2002": "pvb2002",
34-
"person-vehicle-bike-detection-crossroad-0078": "pvbcross78",
3528
"person-vehicle-bike-detection-crossroad-1016": "pvbcross16",
36-
"text-recognition-0012": "textrec",
37-
"vehicle-license-plate-detection-barrier-0106": "platedetect",
3829
"vehicle-attributes-recognition-barrier-0042": "vehattr",
39-
"vehicle-detection-0200": "veh0200",
40-
"vehicle-detection-0201": "veh0201",
41-
"vehicle-detection-0202": "veh0202",
42-
"vehicle-detection-adas-0002": "vehadas",
43-
# Public models
44-
"text-recognition-resnet-fc": "textresnet",
4530
}
4631

4732

model_installer/src/install-omz-models

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,61 +12,24 @@ from argparse import ArgumentParser
1212
from generate_model_config import generate_model_config
1313

1414
TIMEOUT = 600
15-
NUM_RETRIES = "6"
16-
OMZ_DIR = "/usr/local/lib/open_model_zoo"
1715
MODEL_DIR = os.environ.get("MODEL_DIR") if "MODEL_DIR" in os.environ else "/workspace/models"
1816
OVMS_MODEL_DIR = os.path.join(MODEL_DIR, "ovms")
1917
MODEL_CACHE_DIR = os.path.join(OVMS_MODEL_DIR, "cache")
2018
OVMS_CONFIGFILE = f"{MODEL_DIR}/ovms-config.json"
2119
OMZ_BASE_URL = "https://storage.openvinotoolkit.org/repositories/open_model_zoo/2023.0/models_bin/1"
22-
# Special case: some public models have a different base URL
23-
MODEL_BASE_URLS = {
24-
"text-recognition-resnet-fc": "https://storage.openvinotoolkit.org/repositories/open_model_zoo/public/text-recognition-resnet-fc"
25-
}
2620
MODEL_PROC_FOLDER_URL = "https://raw.githubusercontent.com/open-edge-platform/edge-ai-libraries/refs/heads/release-2025.2.0/libraries/dl-streamer/samples/gstreamer/model_proc/intel/"
2721

2822
_DEFAULT_MODELS = [
2923
'person-detection-retail-0013',
30-
'person-reidentification-retail-0277',
31-
'human-pose-estimation-0001',
32-
]
33-
34-
_OCR_MODELS = [
35-
'horizontal-text-detection-0001',
36-
'text-recognition-resnet-fc',
37-
'text-recognition-0012'
38-
]
39-
40-
_ALL_MODELS = _DEFAULT_MODELS + _OCR_MODELS + [
41-
'pedestrian-and-vehicle-detector-adas-0001',
42-
'person-vehicle-bike-detection-2000',
43-
'person-vehicle-bike-detection-2001',
44-
'person-vehicle-bike-detection-2002',
45-
'person-vehicle-bike-detection-crossroad-0078',
4624
'person-vehicle-bike-detection-crossroad-1016',
47-
'person-attributes-recognition-crossroad-0238',
25+
'person-reidentification-retail-0277',
4826
'age-gender-recognition-retail-0013',
49-
'vehicle-detection-0200',
50-
'vehicle-detection-0201',
51-
'vehicle-detection-0202',
52-
'vehicle-detection-adas-0002',
53-
'vehicle-license-plate-detection-barrier-0106',
54-
'vehicle-attributes-recognition-barrier-0042'
55-
]
56-
57-
# TODO: use download_public_models.sh for downloading supported models
58-
# see: https://github.com/open-edge-platform/edge-ai-libraries/tree/main/libraries/dl-streamer/samples
59-
_PUBLIC_MODELS = [
60-
# This is 1-channel model that is not supported by DLStreamer
61-
# TODO: use ch_PP-OCRv4_rec_infer
62-
'text-recognition-resnet-fc',
27+
'person-attributes-recognition-crossroad-0238',
28+
'vehicle-attributes-recognition-barrier-0042',
6329
]
6430

6531
def _build_argparser():
6632
parser = ArgumentParser()
67-
parser.add_argument("--default", action="store_true", help="Download default models")
68-
parser.add_argument("--ocr", action="store_true", help="Download OCR models")
69-
parser.add_argument("--all", action="store_true", help="Download all models")
7033
parser.add_argument("--precisions", help="Donwload models with specific precisions."
7134
"Comma separated value, with no extra spaces.",
7235
type=str, default="FP32")
@@ -105,7 +68,7 @@ def _download_model(model, precisions, model_subdir, download_proc):
10568
exit_code = 0
10669
for prec in precisions.split(","):
10770
prec = prec.strip()
108-
model_url_dir = MODEL_BASE_URLS.get(model, f"{OMZ_BASE_URL}/{model}/{prec}")
71+
model_url_dir = f"{OMZ_BASE_URL}/{model}/{prec}"
10972
dest_dir = os.path.join(MODEL_DIR, model_subdir, model, prec)
11073
_make_dir(dest_dir)
11174
try:
@@ -153,12 +116,7 @@ def _copy_files(source, destination):
153116

154117
def main():
155118
args = _build_argparser().parse_args()
156-
if args.all:
157-
models = _ALL_MODELS
158-
elif args.ocr:
159-
models = _OCR_MODELS
160-
else:
161-
models = _DEFAULT_MODELS
119+
models = _DEFAULT_MODELS
162120

163121
precisions = args.precisions
164122
proc_files = args.model_proc
@@ -174,7 +132,7 @@ def main():
174132
ovms_config_len = len(ovms_config["model_config_list"])
175133

176134
for model in models:
177-
model_subdir = "public" if model in _PUBLIC_MODELS else "intel"
135+
model_subdir = "intel"
178136
if not os.path.isdir(os.path.join(MODEL_DIR, model_subdir, model)):
179137
# Download model
180138
_download_model(model, precisions, model_subdir, proc_files)

tools/ppl_runner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Building Intel® SceneScape will perform all the above steps and additionally bu
1616
The commands below will perform all the above steps and additionally build all images (adjust environment variables if needed):
1717

1818
```
19-
make MODELS=all PRECISIONS=FP32
19+
make install-models PRECISIONS=FP32
2020
make init-sample-data
2121
```
2222

0 commit comments

Comments
 (0)