From 7ed31cac0ee84abbf06c3a9da83621495f4b948e Mon Sep 17 00:00:00 2001 From: Boris Sekachev <40690378+bsekachev@users.noreply.github.com> Date: Mon, 15 Apr 2019 13:36:18 +0300 Subject: [PATCH] OpenVINOR5 (#400) --- components/openvino/install.sh | 12 +++++++++--- components/tf_annotation/install.sh | 14 +------------- cvat/apps/tf_annotation/views.py | 8 ++------ 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/components/openvino/install.sh b/components/openvino/install.sh index 13c243cc..51277772 100755 --- a/components/openvino/install.sh +++ b/components/openvino/install.sh @@ -23,12 +23,18 @@ tar -xzf `ls | grep "openvino_toolkit"` cd `ls -d */ | grep "openvino_toolkit"` apt-get update && apt-get install -y sudo cpio && \ - ./install_cv_sdk_dependencies.sh && SUDO_FORCE_REMOVE=yes apt-get remove -y sudo + if [ -f "install_cv_sdk_dependencies.sh" ]; then ./install_cv_sdk_dependencies.sh; \ + else ./install_openvino_dependencies.sh; fi && SUDO_FORCE_REMOVE=yes apt-get remove -y sudo cat ../eula.cfg >> silent.cfg ./install.sh -s silent.cfg cd /tmp/components && rm openvino -r -echo "source /opt/intel/computer_vision_sdk/bin/setupvars.sh" >> ${HOME}/.bashrc -echo -e '\nexport IE_PLUGINS_PATH=${IE_PLUGINS_PATH}' >> /opt/intel/computer_vision_sdk/bin/setupvars.sh +if [ -f "/opt/intel/computer_vision_sdk/bin/setupvars.sh" ]; then + echo "source /opt/intel/computer_vision_sdk/bin/setupvars.sh" >> ${HOME}/.bashrc; + echo -e '\nexport IE_PLUGINS_PATH=${IE_PLUGINS_PATH}' >> /opt/intel/computer_vision_sdk/bin/setupvars.sh; +else + echo "source /opt/intel/openvino/bin/setupvars.sh" >> ${HOME}/.bashrc; + echo -e '\nexport IE_PLUGINS_PATH=${IE_PLUGINS_PATH}' >> /opt/intel/openvino/bin/setupvars.sh; +fi diff --git a/components/tf_annotation/install.sh b/components/tf_annotation/install.sh index 0bf3f8d3..bdd1c6e2 100755 --- a/components/tf_annotation/install.sh +++ b/components/tf_annotation/install.sh @@ -16,17 +16,5 @@ if [[ "$CUDA_SUPPORT" = "yes" ]] then pip3 install --no-cache-dir tensorflow-gpu==1.7.0 else - if [[ "$OPENVINO_TOOLKIT" = "yes" ]] - then - pip3 install -r ${INTEL_CVSDK_DIR}/deployment_tools/model_optimizer/requirements.txt && \ - cd ${HOME}/rcnn/ && \ - ${INTEL_CVSDK_DIR}/deployment_tools/model_optimizer/mo.py --framework tf \ - --data_type FP32 --input_shape [1,600,600,3] \ - --input image_tensor --output detection_scores,detection_boxes,num_detections \ - --tensorflow_use_custom_operations_config ${INTEL_CVSDK_DIR}/deployment_tools/model_optimizer/extensions/front/tf/faster_rcnn_support.json \ - --tensorflow_object_detection_api_pipeline_config pipeline.config --input_model inference_graph.pb && \ - rm inference_graph.pb - else - pip3 install --no-cache-dir tensorflow==1.7.0 - fi + pip3 install --no-cache-dir tensorflow==1.7.0 fi diff --git a/cvat/apps/tf_annotation/views.py b/cvat/apps/tf_annotation/views.py index a3f893c3..729da1fc 100644 --- a/cvat/apps/tf_annotation/views.py +++ b/cvat/apps/tf_annotation/views.py @@ -219,12 +219,8 @@ def create_thread(tid, labels_mapping): # Run auto annotation by tf result = None - if os.environ.get('CUDA_SUPPORT') == 'yes' or os.environ.get('OPENVINO_TOOLKIT') != 'yes': - slogger.glob.info("tf annotation with tensorflow framework for task {}".format(tid)) - result = run_tensorflow_annotation(image_list, labels_mapping, TRESHOLD) - else: - slogger.glob.info('tf annotation with openvino toolkit for task {}'.format(tid)) - result = run_inference_engine_annotation(image_list, labels_mapping, TRESHOLD) + slogger.glob.info("tf annotation with tensorflow framework for task {}".format(tid)) + result = run_tensorflow_annotation(image_list, labels_mapping, TRESHOLD) if result is None: slogger.glob.info('tf annotation for task {} canceled by user'.format(tid))