smart-video-workshop
smart-video-workshop copied to clipboard
OpenVINO Python samples
Python implementation for classification is for usage in hardware-heterogeneity workshop module.
root@intel-Default-string:/opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/inference_engine/samples/python_samples# python3 classification_sample.py -i /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp -m /opt/intel/workshop/smart-video-workshop/object-detection/squeezenet1.1.xml -d HETERO:CPU,GPU -pc
[ INFO ] Loading network files:
/opt/intel/workshop/smart-video-workshop/object-detection/squeezenet1.1.xml
/opt/intel/workshop/smart-video-workshop/object-detection/squeezenet1.1.bin
classification_sample.py:65: DeprecationWarning: from_ir() method of IENetwork is deprecated. Please use IENetwork class constructor to create valid IENetwork instance
net = IENetwork.from_ir(model=model_xml, weights=model_bin)
[ INFO ] Preparing input blobs
[ WARNING ] Image /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp is resized from (637, 749) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference (1 iterations)
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp
899 0.2101035 label water jug
882 0.1619391 label vacuum, vacuum cleaner
438 0.0896354 label beaker
804 0.0695653 label soap dispenser
898 0.0602502 label water bottle
503 0.0573366 label cocktail shaker
818 0.0302898 label spotlight, spot
505 0.0283234 label coffeepot
604 0.0228083 label hourglass
859 0.0183770 label toaster
[ INFO ] Average running time of one iteration: 4.743099212646484 ms
[ INFO ] total running time of inference: 4.743099212646484 ms
[ INFO ] Throughput: 210.8326128480949 FPS
performance counts:
subgraph0: conv10 EXECUTED layerType: Convolution realTime: 823 cpu: 823 execType: jit_avx2_1x1_FP32
subgraph0: fire2/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/squeeze1x1 EXECUTED layerType: Convolution realTime: 56 cpu: 56 execType: jit_avx2_1x1_FP32
subgraph0: fire6/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/expand1x1 EXECUTED layerType: Convolution realTime: 29 cpu: 29 execType: jit_avx2_1x1_FP32
subgraph0: fire4/squeeze1x1 EXECUTED layerType: Convolution realTime: 30 cpu: 30 execType: jit_avx2_1x1_FP32
subgraph0: fire5/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire7/expand3x3 EXECUTED layerType: Convolution realTime: 140 cpu: 140 execType: jit_avx2_FP32
subgraph0: fire3/expand3x3 EXECUTED layerType: Convolution realTime: 212 cpu: 212 execType: jit_avx2_FP32
subgraph0: fire3/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire7/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/expand1x1 EXECUTED layerType: Convolution realTime: 30 cpu: 30 execType: jit_avx2_1x1_FP32
subgraph0: fire3/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire6/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire2/squeeze1x1 EXECUTED layerType: Convolution realTime: 33 cpu: 33 execType: jit_avx2_1x1_FP32
subgraph0: fire9/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire6/expand3x3 EXECUTED layerType: Convolution realTime: 137 cpu: 137 execType: jit_avx2_FP32
subgraph0: fire9/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/squeeze1x1 EXECUTED layerType: Convolution realTime: 56 cpu: 56 execType: jit_avx2_1x1_FP32
subgraph0: fire8/expand1x1 EXECUTED layerType: Convolution realTime: 31 cpu: 31 execType: jit_avx2_1x1_FP32
subgraph0: fire2/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire8/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire6/expand1x1 EXECUTED layerType: Convolution realTime: 18 cpu: 18 execType: jit_avx2_1x1_FP32
subgraph0: pool3 EXECUTED layerType: Pooling realTime: 35 cpu: 35 execType: jit_avx_FP32
subgraph0: fire8/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire8/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: prob_nChw8c_nchw_out_prob EXECUTED layerType: Reorder realTime: 3 cpu: 3 execType: reorder_FP32
subgraph0: fire7/expand1x1 EXECUTED layerType: Convolution realTime: 18 cpu: 18 execType: jit_avx2_1x1_FP32
subgraph0: fire8/squeeze1x1 EXECUTED layerType: Convolution realTime: 43 cpu: 43 execType: jit_avx2_1x1_FP32
subgraph0: fire8/expand3x3 EXECUTED layerType: Convolution realTime: 248 cpu: 248 execType: jit_avx2_FP32
subgraph0: fire4/expand1x1 EXECUTED layerType: Convolution realTime: 29 cpu: 29 execType: jit_avx2_1x1_FP32
subgraph0: fire9/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/expand3x3 EXECUTED layerType: Convolution realTime: 219 cpu: 219 execType: jit_avx2_FP32
subgraph0: fire6/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/squeeze1x1 EXECUTED layerType: Convolution realTime: 57 cpu: 57 execType: jit_avx2_1x1_FP32
subgraph0: fire5/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: pool5 EXECUTED layerType: Pooling realTime: 24 cpu: 24 execType: jit_avx_FP32
subgraph0: fire2/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: conv1 EXECUTED layerType: Convolution realTime: 473 cpu: 473 execType: jit_avx2_FP32
subgraph0: fire2/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire6/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: pool10 EXECUTED layerType: Pooling realTime: 14 cpu: 14 execType: jit_avx_FP32
subgraph0: fire7/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: prob EXECUTED layerType: SoftMax realTime: 280 cpu: 280 execType: ref_any_FP32
subgraph0: fire7/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: out_prob NOT_RUN layerType: Output realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire7/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: fire2/expand1x1 EXECUTED layerType: Convolution realTime: 36 cpu: 36 execType: jit_avx2_1x1_FP32
subgraph0: fire4/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/expand1x1 EXECUTED layerType: Convolution realTime: 28 cpu: 28 execType: jit_avx2_1x1_FP32
subgraph0: fire9/expand3x3 EXECUTED layerType: Convolution realTime: 246 cpu: 246 execType: jit_avx2_FP32
subgraph0: fire6/squeeze1x1 EXECUTED layerType: Convolution realTime: 24 cpu: 24 execType: jit_avx2_1x1_FP32
subgraph0: fire2/expand3x3 EXECUTED layerType: Convolution realTime: 212 cpu: 212 execType: jit_avx2_FP32
subgraph0: relu_conv1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/concat NOT_RUN layerType: Concat realTime: 0 cpu: 0 execType: unknown_FP32
subgraph0: pool1 EXECUTED layerType: Pooling realTime: 328 cpu: 328 execType: jit_avx_FP32
subgraph0: fire5/expand3x3 EXECUTED layerType: Convolution realTime: 237 cpu: 237 execType: jit_avx2_FP32
subgraph0: fire7/squeeze1x1 EXECUTED layerType: Convolution realTime: 33 cpu: 33 execType: jit_avx2_1x1_FP32
subgraph0: relu_conv10 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire8/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
TotalTime: 4182 microseconds
[ INFO ] Execution successful
root@intel-Default-string:/opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/inference_engine/samples/python_samples# python3 classification_sample.py -i /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp -m /opt/intel/workshop/smart-video-workshop/object-detection/squeezenet1.1.xml -d HETERO:GPU,CPU -pc
[ INFO ] Loading network files:
/opt/intel/workshop/smart-video-workshop/object-detection/squeezenet1.1.xml
/opt/intel/workshop/smart-video-workshop/object-detection/squeezenet1.1.bin
classification_sample.py:65: DeprecationWarning: from_ir() method of IENetwork is deprecated. Please use IENetwork class constructor to create valid IENetwork instance
net = IENetwork.from_ir(model=model_xml, weights=model_bin)
[ INFO ] Preparing input blobs
[ WARNING ] Image /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp is resized from (637, 749) to (227, 227)
[ INFO ] Batch size is 1
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference (1 iterations)
[ INFO ] Processing output blob
[ INFO ] Top 10 results:
Image /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp
899 0.2101042 label water jug
882 0.1619387 label vacuum, vacuum cleaner
438 0.0896353 label beaker
804 0.0695648 label soap dispenser
898 0.0602503 label water bottle
503 0.0573367 label cocktail shaker
818 0.0302897 label spotlight, spot
505 0.0283233 label coffeepot
604 0.0228082 label hourglass
859 0.0183771 label toaster
[ INFO ] Average running time of one iteration: 7.160186767578125 ms
[ INFO ] total running time of inference: 7.160186767578125 ms
[ INFO ] Throughput: 139.66116142781033 FPS
performance counts:
subgraph0: fire2/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/expand1x1 EXECUTED layerType: Convolution realTime: 162 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire5/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire2/expand1x1 EXECUTED layerType: Convolution realTime: 131 cpu: 5 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire6/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire7/expand3x3 EXECUTED layerType: Convolution realTime: 140 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire3/squeeze1x1 EXECUTED layerType: Convolution realTime: 102 cpu: 5 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire7/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: fire7/expand1x1 EXECUTED layerType: Convolution realTime: 72 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire2/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: pool3 EXECUTED layerType: Pooling realTime: 78 cpu: 4 execType: pooling_gpu_ref
subgraph0: fire6/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire7/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: conv1 EXECUTED layerType: Convolution realTime: 457 cpu: 11 execType: convolution_gpu_bfyx_gemm_like
subgraph0: prob NOT_RUN layerType: SoftMax realTime: 0 cpu: 0 execType: undef
subgraph0: relu_conv1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: relu_conv10 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: data_cldnn_input_preprocess NOT_RUN layerType: Reorder realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/expand1x1 EXECUTED layerType: Convolution realTime: 83 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire5/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: pool5 EXECUTED layerType: Pooling realTime: 60 cpu: 4 execType: pooling_gpu_ref
subgraph0: fire2/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire3/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/expand3x3 EXECUTED layerType: Convolution realTime: 236 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire3/expand3x3 EXECUTED layerType: Convolution realTime: 241 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire4/expand3x3 EXECUTED layerType: Convolution realTime: 245 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire8/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/squeeze1x1 EXECUTED layerType: Convolution realTime: 63 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire8/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire6/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/expand1x1 EXECUTED layerType: Convolution realTime: 118 cpu: 5 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire8/squeeze1x1 EXECUTED layerType: Convolution realTime: 52 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire8/expand3x3 EXECUTED layerType: Convolution realTime: 235 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire8/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire2/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire6/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/expand3x3 EXECUTED layerType: Convolution realTime: 252 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire4/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire6/expand1x1 EXECUTED layerType: Convolution realTime: 70 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire9/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: pool1 EXECUTED layerType: Pooling realTime: 148 cpu: 5 execType: pooling_gpu_bfyx_block_opt
subgraph0: fire8/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: conv10 EXECUTED layerType: Convolution realTime: 854 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire7/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/squeeze1x1 EXECUTED layerType: Convolution realTime: 69 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire8/expand1x1 EXECUTED layerType: Convolution realTime: 86 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire6/expand3x3 EXECUTED layerType: Convolution realTime: 140 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: pool10 EXECUTED layerType: Pooling realTime: 159 cpu: 4 execType: pooling_gpu_ref
subgraph0: fire5/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: prob_cldnn_output_postprocess EXECUTED layerType: Reorder realTime: 18 cpu: 4 execType: softmax_gpu_bf
subgraph0: fire7/squeeze1x1 EXECUTED layerType: Convolution realTime: 50 cpu: 8 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire6/squeeze1x1 EXECUTED layerType: Convolution realTime: 41 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire4/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire2/squeeze1x1 EXECUTED layerType: Convolution realTime: 59 cpu: 5 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire7/relu_expand3x3 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: fire5/expand1x1 EXECUTED layerType: Convolution realTime: 115 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire2/expand3x3 EXECUTED layerType: Convolution realTime: 239 cpu: 4 execType: convolution_gpu_bfyx_gemm_like
subgraph0: fire4/squeeze1x1 EXECUTED layerType: Convolution realTime: 47 cpu: 4 execType: convolution_gpu_bfyx_os_iyx_osv16
subgraph0: fire3/relu_squeeze1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
subgraph0: fire9/concat OPTIMIZED_OUT layerType: Concat realTime: 0 cpu: 0 execType: undef
subgraph0: fire4/relu_expand1x1 NOT_RUN layerType: ReLU realTime: 0 cpu: 0 execType: undef
TotalTime: 4822 microseconds
[ INFO ] Execution successful
Python implementation for security_barrier_camera sample is for usage in advanced video analytics workshop module.
python3 security_barrier_camera.py -i /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/demo/car_1.bmp -m /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/intel_models/vehicle-license-plate-detection-barrier-0106/FP32/vehicle-license-plate-detection-barrier-0106.xml -m_va /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/intel_models/vehicle-attributes-recognition-barrier-0039/FP32/vehicle-attributes-recognition-barrier-0039.xml -m_lpr /opt/intel/computer_vision_sdk_2018.5.431/deployment_tools/intel_models/license-plate-recognition-barrier-0001/FP32/license-plate-recognition-barrier-0001.xml -d CPU