diff --git a/src/inference/utils.py b/src/inference/utils.py index 27d32e7e7..aa3c86b3f 100644 --- a/src/inference/utils.py +++ b/src/inference/utils.py @@ -2,6 +2,8 @@ try: from openvino.runtime import Core, Tensor, PartialShape + import openvino.properties as props + import openvino.properties.hint as hints _ov_runtime_supported = True except ImportError: _ov_runtime_supported = False @@ -84,21 +86,23 @@ def set_property(core, devices, nthreads, nstreams, dump, mode): for device in device_list: if device == 'CPU': if nthreads: - core.set_property('CPU', {'CPU_THREADS_NUM': str(nthreads)}) + core.set_property('CPU', {props.inference_num_threads: nthreads}) if 'MULTI' in devices and 'GPU' in devices: core.set_property({'CPU_BIND_THREAD': 'NO'}, 'CPU') if mode == 'async': - cpu_throughput = {'CPU_THROUGHPUT_STREAMS': 'CPU_THROUGHPUT_AUTO'} + core.set_property('CPU', {hints.performance_mode: hints.PerformanceMode.THROUGHPUT}) + cpu_throughput = {props.num_streams: props.streams.Num.AUTO} if device in streams_dict.keys() and streams_dict[device]: - cpu_throughput['CPU_THROUGHPUT_STREAMS'] = streams_dict['CPU'] + cpu_throughput[props.num_streams] = streams_dict['CPU'] core.set_property('CPU', cpu_throughput) if device == 'GPU': if 'MULTI' in devices and 'СPU' in devices: core.set_property('GPU', {'GPU_QUEUE_THROTTLE': '1'}) if mode == 'async': - gpu_throughput = {'GPU_THROUGHPUT_STREAMS': 'GPU_THROUGHPUT_AUTO'} + core.set_property('GPU', {hints.performance_mode: hints.PerformanceMode.THROUGHPUT}) + gpu_throughput = {props.num_streams: props.streams.Num.AUTO} if device in streams_dict.keys() and streams_dict[device]: - gpu_throughput['GPU_THROUGHPUT_STREAMS'] = streams_dict['GPU'] + gpu_throughput[props.num_streams] = streams_dict['GPU'] core.set_property('GPU', gpu_throughput) if dump: if 'HETERO' in devices: diff --git a/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_async_mode.xml b/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_async_mode.xml index 64c470125..43c9a3560 100644 --- a/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_async_mode.xml +++ b/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_async_mode.xml @@ -28,4 +28,32 @@ + + + classification + mobilenet-v1-1.0-224-tf + FP32 + tf + ../models_dir/public/mobilenet-v1-1.0-224-tf/FP32/mobilenet-v1-1.0-224-tf.xml + ../models_dir/public/mobilenet-v1-1.0-224-tf/FP32/mobilenet-v1-1.0-224-tf.bin + + + Data + ../test_images/black_square.jpg + + + OpenVINO DLDT + 1 + CPU + 5 + 1 + + + async + + 1 + + 2 + + diff --git a/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_sync_mode.xml b/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_sync_mode.xml index 9686bee1e..6b7a8f622 100644 --- a/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_sync_mode.xml +++ b/tests/smoke_test/configs/dl_models/mobilenet-v1-1.0-224-tf_OpenVINO_DLDT_sync_mode.xml @@ -28,4 +28,32 @@ + + + classification + mobilenet-v1-1.0-224-tf + FP32 + tf + ../models_dir/public/mobilenet-v1-1.0-224-tf/FP32/mobilenet-v1-1.0-224-tf.xml + ../models_dir/public/mobilenet-v1-1.0-224-tf/FP32/mobilenet-v1-1.0-224-tf.bin + + + Data + ../test_images/black_square.jpg + + + OpenVINO DLDT + 1 + CPU + 5 + 1 + + + sync + + + 2 + + +