Skip to content

Commit e1069f3

Browse files
Classification demo readme fix (#2962)
* upd readme for py/classification_demo * Apply suggestions from code review Co-authored-by: Anzhella Pankratova <[email protected]> * Update demos/classification_demo/python/README.md * upd transform args in classification_demo.py Co-authored-by: Anzhella Pankratova <[email protected]>
1 parent 09a1688 commit e1069f3

File tree

2 files changed

+46
-24
lines changed

2 files changed

+46
-24
lines changed

demos/classification_demo/python/README.md

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -130,60 +130,82 @@ and `<omz_dir>/data/dataset_classes/imagenet_2012.txt` labels file with all othe
130130
Running the application with the `-h` option yields the following usage message:
131131

132132
```
133-
usage: classification_demo.py [-h] -m MODEL -i INPUT [-d DEVICE] --labels LABELS [-ntop {1,2,3,4,5,6,7,8,9,10}]
134-
[-nireq NUM_INFER_REQUESTS] [-nstreams NUM_STREAMS] [-nthreads NUM_THREADS] [--loop]
135-
[-o OUTPUT] [-limit OUTPUT_LIMIT] [--no_show] [--output_resolution OUTPUT_RESOLUTION]
136-
[-u UTILIZATION_MONITORS] [--reverse_input_channels]
133+
usage: classification_demo.py [-h] -m MODEL [--adapter {openvino,remote}] -i INPUT
134+
[-d DEVICE] [--labels LABELS]
135+
[-topk {1,2,3,4,5,6,7,8,9,10}]
136+
[-nireq NUM_INFER_REQUESTS]
137+
[-nstreams NUM_STREAMS] [-nthreads NUM_THREADS]
138+
[--loop] [-o OUTPUT] [-limit OUTPUT_LIMIT]
139+
[--no_show]
140+
[--output_resolution OUTPUT_RESOLUTION]
141+
[-u UTILIZATION_MONITORS]
142+
[--reverse_input_channels]
137143
[--mean_values MEAN_VALUES MEAN_VALUES MEAN_VALUES]
138-
[--scale_values SCALE_VALUES SCALE_VALUES SCALE_VALUES] [-r]
144+
[--scale_values SCALE_VALUES SCALE_VALUES SCALE_VALUES]
145+
[-r]
139146
140147
Options:
141148
-h, --help Show this help message and exit.
142149
-m MODEL, --model MODEL
143150
Required. Path to an .xml file with a trained model.
151+
--adapter {openvino,remote}
152+
Optional. Specify the model adapter. Default is
153+
openvino.
144154
-i INPUT, --input INPUT
145-
Required. An input to process. The input must be a single image, a folder of images, video
146-
file or camera id.
155+
Required. An input to process. The input must be a
156+
single image, a folder of images, video file or camera
157+
id.
147158
-d DEVICE, --device DEVICE
148-
Optional. Specify the target device to infer on; CPU, GPU, HDDL or MYRIAD is acceptable. The
149-
demo will look for a suitable plugin for device specified. Default value is CPU.
159+
Optional. Specify the target device to infer on; CPU,
160+
GPU, HDDL or MYRIAD is acceptable. The demo will look
161+
for a suitable plugin for device specified. Default
162+
value is CPU.
150163
151164
Common model options:
152-
--labels LABELS Required. Labels mapping file.
153-
-ntop {1,2,3,4,5,6,7,8,9,10}
154-
Optional. Number of top results. Default value is 5. Must be from 1 to 10.
165+
--labels LABELS Optional. Labels mapping file.
166+
-topk {1,2,3,4,5,6,7,8,9,10}
167+
Optional. Number of top results. Default value is 5.
168+
Must be from 1 to 10.
155169
156170
Inference options:
157171
-nireq NUM_INFER_REQUESTS, --num_infer_requests NUM_INFER_REQUESTS
158172
Optional. Number of infer requests
159173
-nstreams NUM_STREAMS, --num_streams NUM_STREAMS
160-
Optional. Number of streams to use for inference on the CPU or/and GPU in throughput mode (for
161-
HETERO and MULTI device cases use format <device1>:<nstreams1>,<device2>:<nstreams2> or just
174+
Optional. Number of streams to use for inference on
175+
the CPU or/and GPU in throughput mode (for HETERO and
176+
MULTI device cases use format
177+
<device1>:<nstreams1>,<device2>:<nstreams2> or just
162178
<nstreams>).
163179
-nthreads NUM_THREADS, --num_threads NUM_THREADS
164-
Optional. Number of threads to use for inference on CPU (including HETERO cases).
180+
Optional. Number of threads to use for inference on
181+
CPU (including HETERO cases).
165182
166183
Input/output options:
167184
--loop Optional. Enable reading the input in a loop.
168185
-o OUTPUT, --output OUTPUT
169186
Optional. Name of the output file(s) to save.
170187
-limit OUTPUT_LIMIT, --output_limit OUTPUT_LIMIT
171-
Optional. Number of frames to store in output. If 0 is set, all frames are stored.
188+
Optional. Number of frames to store in output. If 0 is
189+
set, all frames are stored.
172190
--no_show Optional. Don't show output.
173191
--output_resolution OUTPUT_RESOLUTION
174-
Optional. Specify the maximum output window resolution in (width x height) format. Example:
175-
1280x720. Input frame size used by default.
192+
Optional. Specify the maximum output window resolution
193+
in (width x height) format. Example: 1280x720. Input
194+
frame size used by default.
176195
-u UTILIZATION_MONITORS, --utilization_monitors UTILIZATION_MONITORS
177196
Optional. List of monitors to show initially.
178197
179198
Input transform options:
180199
--reverse_input_channels
181-
Optional. Switch the input channels order from BGR to RGB.
200+
Optional. Switch the input channels order from BGR to
201+
RGB.
182202
--mean_values MEAN_VALUES MEAN_VALUES MEAN_VALUES
183-
Optional. Normalize input by subtracting the mean values per channel. Example: 255 255 255
203+
Optional. Normalize input by subtracting the mean
204+
values per channel. Example: 255.0 255.0 255.0
184205
--scale_values SCALE_VALUES SCALE_VALUES SCALE_VALUES
185-
Optional. Divide input by scale values per channel. Division is applied after mean values
186-
subtraction. Example: 255 255 255
206+
Optional. Divide input by scale values per channel.
207+
Division is applied after mean values subtraction.
208+
Example: 255.0 255.0 255.0
187209
188210
Debug options:
189211
-r, --raw_output_message

demos/classification_demo/python/classification_demo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ def build_argparser():
9292
'BGR to RGB.')
9393
input_transform_args.add_argument('--mean_values', default=None, type=float, nargs=3,
9494
help='Optional. Normalize input by subtracting the mean '
95-
'values per channel. Example: 255 255 255')
95+
'values per channel. Example: 255.0 255.0 255.0')
9696
input_transform_args.add_argument('--scale_values', default=None, type=float, nargs=3,
9797
help='Optional. Divide input by scale values per channel. '
9898
'Division is applied after mean values subtraction. '
99-
'Example: 255 255 255')
99+
'Example: 255.0 255.0 255.0')
100100

101101
debug_args = parser.add_argument_group('Debug options')
102102
debug_args.add_argument('-r', '--raw_output_message', help='Optional. Output inference results raw values showing.',

0 commit comments

Comments
 (0)