Fixed shellcheck issues (#6141)
This commit is contained in:
parent
c3d1c2e420
commit
b4e6028f8b
@ -169,10 +169,11 @@ ie_shellcheck_process(DIRECTORY "${OpenVINO_MAIN_SOURCE_DIR}"
|
||||
"${IE_MAIN_SOURCE_DIR}/thirdparty"
|
||||
"${IE_MAIN_SOURCE_DIR}/temp"
|
||||
# TODO fix and enable back:
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/install_dependencies"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/demo"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/ngraph"
|
||||
"${IE_MAIN_SOURCE_DIR}/scripts")
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/scripts/dependencies.sh"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/install_dependencies/install_NEO_OCL_driver.sh"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/scripts/install_dependencies/install_openvino_dependencies.sh"
|
||||
"${OpenVINO_MAIN_SOURCE_DIR}/ngraph/python/tests/test_onnx/model_zoo_preprocess.sh"
|
||||
)
|
||||
|
||||
#
|
||||
# cpack
|
||||
|
@ -55,7 +55,7 @@ fi
|
||||
|
||||
if [[ "${APPS_TO_RUN}" -ge 4 ]] ; then
|
||||
# For more then 4 multidevice testing
|
||||
for (( VAR = 4; VAR <= ${APPS_TO_RUN}; ++VAR )); do
|
||||
for (( VAR = 4; VAR <= APPS_TO_RUN; ++VAR )); do
|
||||
./${APP_NAME} --gtest_filter=*VPURegTest*YOLO*myriad* &
|
||||
pids+=" $!"
|
||||
done
|
||||
|
@ -50,7 +50,7 @@ fi
|
||||
|
||||
target_precision="FP16"
|
||||
|
||||
printf "target_precision = ${target_precision}\n"
|
||||
printf "target_precision = %s\n" ${target_precision}
|
||||
|
||||
models_path="$HOME/openvino_models/models"
|
||||
models_cache="$HOME/openvino_models/cache"
|
||||
@ -71,12 +71,12 @@ else
|
||||
fi
|
||||
|
||||
if ! . "$setupvars_path" ; then
|
||||
printf "Unable to run ./setupvars.sh. Please check its presence. ${run_again}"
|
||||
printf "Unable to run ./setupvars.sh. Please check its presence. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Step 1. Download the Caffe model and the prototxt of the model
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "\n\nDownloading the Caffe model and the prototxt"
|
||||
|
||||
cur_path=$PWD
|
||||
@ -119,7 +119,7 @@ elif [[ $DISTRO == "ubuntu" ]]; then
|
||||
python_binary=python3
|
||||
pip_binary=pip3
|
||||
|
||||
system_ver=`cat /etc/lsb-release | grep -i "DISTRIB_RELEASE" | cut -d "=" -f2`
|
||||
system_ver=$(grep -i "DISTRIB_RELEASE" -f /etc/lsb-release | cut -d "=" -f2)
|
||||
if [ "$system_ver" = "16.04" ]; then
|
||||
sudo -E apt-get install -y libpng12-dev
|
||||
else
|
||||
@ -143,7 +143,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
fi
|
||||
|
||||
if ! command -v $python_binary &>/dev/null; then
|
||||
printf "\n\nPython 3.5 (x64) or higher is not installed. It is required to run Model Optimizer, please install it. ${run_again}"
|
||||
printf "\n\nPython 3.5 (x64) or higher is not installed. It is required to run Model Optimizer, please install it. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -166,14 +166,14 @@ ir_dir="${irs_path}/${model_dir}/${target_precision}"
|
||||
|
||||
if [ ! -e "$ir_dir" ]; then
|
||||
# Step 2. Configure Model Optimizer
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Install Model Optimizer dependencies\n\n"
|
||||
cd "${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/install_prerequisites"
|
||||
. ./install_prerequisites.sh caffe
|
||||
cd "$cur_path"
|
||||
|
||||
# Step 3. Convert a model with Model Optimizer
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Convert a model with Model Optimizer\n\n"
|
||||
|
||||
mo_path="${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/mo.py"
|
||||
@ -181,12 +181,12 @@ if [ ! -e "$ir_dir" ]; then
|
||||
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
|
||||
print_and_run "$python_binary" "$downloader_dir/converter.py" --mo "$mo_path" --name "$model_name" -d "$models_path" -o "$irs_path" --precisions "$target_precision"
|
||||
else
|
||||
printf "\n\nTarget folder ${ir_dir} already exists. Skipping IR generation with Model Optimizer."
|
||||
printf "If you want to convert a model again, remove the entire ${ir_dir} folder. ${run_again}"
|
||||
printf "\n\nTarget folder %s already exists. Skipping IR generation with Model Optimizer." "${ir_dir}"
|
||||
printf "If you want to convert a model again, remove the entire %s folder. %s" "${ir_dir}" "${run_again}"
|
||||
fi
|
||||
|
||||
# Step 4. Build samples
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Build Inference Engine samples\n\n"
|
||||
|
||||
OS_PATH=$(uname -m)
|
||||
@ -211,15 +211,15 @@ cmake -DCMAKE_BUILD_TYPE=Release "$samples_path"
|
||||
make $NUM_THREADS benchmark_app
|
||||
|
||||
# Step 5. Run samples
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Run Inference Engine benchmark app\n\n"
|
||||
|
||||
cd "$binaries_dir"
|
||||
|
||||
cp -f "$ROOT_DIR/${model_name}.labels" "${ir_dir}/"
|
||||
|
||||
print_and_run ./benchmark_app -d "$target" -i "$target_image_path" -m "${ir_dir}/${model_name}.xml" -pc ${sampleoptions}
|
||||
print_and_run ./benchmark_app -d "$target" -i "$target_image_path" -m "${ir_dir}/${model_name}.xml" -pc "${sampleoptions}"
|
||||
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
|
||||
printf "Inference Engine benchmark app completed successfully.\n\n"
|
||||
|
@ -88,7 +88,7 @@ elif [[ $DISTRO == "ubuntu" ]]; then
|
||||
python_binary=python3
|
||||
pip_binary=pip3
|
||||
|
||||
system_ver=`cat /etc/lsb-release | grep -i "DISTRIB_RELEASE" | cut -d "=" -f2`
|
||||
system_ver=$(grep -i "DISTRIB_RELEASE" -f /etc/lsb-release | cut -d "=" -f2)
|
||||
if [ "$system_ver" = "16.04" ]; then
|
||||
sudo -E apt-get install -y libpng12-dev
|
||||
else
|
||||
@ -112,7 +112,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
fi
|
||||
|
||||
if ! command -v $python_binary &>/dev/null; then
|
||||
printf "\n\nPython 3.5 (x64) or higher is not installed. It is required to run Model Optimizer, please install it. ${run_again}"
|
||||
printf "\n\nPython 3.5 (x64) or higher is not installed. It is required to run Model Optimizer, please install it. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -128,18 +128,18 @@ else
|
||||
printf "Error: setupvars.sh is not found\n"
|
||||
fi
|
||||
if ! . "$setupvars_path" ; then
|
||||
printf "Unable to run ./setupvars.sh. Please check its presence. ${run_again}"
|
||||
printf "Unable to run ./setupvars.sh. Please check its presence. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Step 1. Downloading Intel models
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Downloading Intel models\n\n"
|
||||
|
||||
|
||||
target_precision="FP16"
|
||||
|
||||
printf "target_precision = ${target_precision}\n"
|
||||
printf "target_precision = %s\n" "${target_precision}"
|
||||
|
||||
downloader_dir="${INTEL_OPENVINO_DIR}/deployment_tools/open_model_zoo/tools/downloader"
|
||||
|
||||
@ -161,13 +161,13 @@ while read -r model_opt model_name; do
|
||||
done < "$ROOT_DIR/demo_security_barrier_camera.conf"
|
||||
|
||||
# Step 2. Build samples
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Build Inference Engine demos\n\n"
|
||||
|
||||
demos_path="${INTEL_OPENVINO_DIR}/deployment_tools/open_model_zoo/demos"
|
||||
|
||||
if ! command -v cmake &>/dev/null; then
|
||||
printf "\n\nCMAKE is not installed. It is required to build Inference Engine demos. Please install it. ${run_again}"
|
||||
printf "\n\nCMAKE is not installed. It is required to build Inference Engine demos. Please install it. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -189,13 +189,13 @@ cmake -DCMAKE_BUILD_TYPE=Release "$demos_path"
|
||||
make $NUM_THREADS security_barrier_camera_demo
|
||||
|
||||
# Step 3. Run samples
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Run Inference Engine security_barrier_camera demo\n\n"
|
||||
|
||||
binaries_dir="${build_dir}/${OS_PATH}/Release"
|
||||
cd "$binaries_dir"
|
||||
|
||||
print_and_run ./security_barrier_camera_demo -d "$target" -d_va "$target" -d_lpr "$target" -i "$target_image_path" "${model_args[@]}" ${sampleoptions}
|
||||
print_and_run ./security_barrier_camera_demo -d "$target" -d_va "$target" -d_lpr "$target" -i "$target_image_path" "${model_args[@]}" "${sampleoptions}"
|
||||
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Demo completed successfully.\n\n"
|
||||
|
@ -46,7 +46,7 @@ done
|
||||
|
||||
target_precision="FP16"
|
||||
|
||||
printf "target_precision = ${target_precision}\n"
|
||||
printf "target_precision = %s\n" "${target_precision}"
|
||||
|
||||
models_path="$HOME/openvino_models/models"
|
||||
models_cache="$HOME/openvino_models/cache"
|
||||
@ -67,12 +67,12 @@ else
|
||||
fi
|
||||
|
||||
if ! . "$setupvars_path" ; then
|
||||
printf "Unable to run ./setupvars.sh. Please check its presence. ${run_again}"
|
||||
printf "Unable to run ./setupvars.sh. Please check its presence. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Step 1. Download the Caffe model and the prototxt of the model
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "\n\nDownloading the Caffe model and the prototxt"
|
||||
|
||||
cur_path=$PWD
|
||||
@ -115,7 +115,7 @@ elif [[ $DISTRO == "ubuntu" ]]; then
|
||||
python_binary=python3
|
||||
pip_binary=pip3
|
||||
|
||||
system_ver=`cat /etc/lsb-release | grep -i "DISTRIB_RELEASE" | cut -d "=" -f2`
|
||||
system_ver=$(grep -i "DISTRIB_RELEASE" -f /etc/lsb-release | cut -d "=" -f2)
|
||||
if [ "$system_ver" = "16.04" ]; then
|
||||
sudo -E apt-get install -y libpng12-dev
|
||||
else
|
||||
@ -139,7 +139,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
fi
|
||||
|
||||
if ! command -v $python_binary &>/dev/null; then
|
||||
printf "\n\nPython 3.5 (x64) or higher is not installed. It is required to run Model Optimizer, please install it. ${run_again}"
|
||||
printf "\n\nPython 3.5 (x64) or higher is not installed. It is required to run Model Optimizer, please install it. %s" "${run_again}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -162,14 +162,14 @@ ir_dir="${irs_path}/${model_dir}/${target_precision}"
|
||||
|
||||
if [ ! -e "$ir_dir" ]; then
|
||||
# Step 2. Configure Model Optimizer
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Install Model Optimizer dependencies\n\n"
|
||||
cd "${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/install_prerequisites"
|
||||
. ./install_prerequisites.sh caffe
|
||||
cd "$cur_path"
|
||||
|
||||
# Step 3. Convert a model with Model Optimizer
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Convert a model with Model Optimizer\n\n"
|
||||
|
||||
mo_path="${INTEL_OPENVINO_DIR}/deployment_tools/model_optimizer/mo.py"
|
||||
@ -177,12 +177,12 @@ if [ ! -e "$ir_dir" ]; then
|
||||
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
|
||||
print_and_run "$python_binary" "$downloader_dir/converter.py" --mo "$mo_path" --name "$model_name" -d "$models_path" -o "$irs_path" --precisions "$target_precision"
|
||||
else
|
||||
printf "\n\nTarget folder ${ir_dir} already exists. Skipping IR generation with Model Optimizer."
|
||||
printf "If you want to convert a model again, remove the entire ${ir_dir} folder. ${run_again}"
|
||||
printf "\n\nTarget folder %s already exists. Skipping IR generation with Model Optimizer." "${ir_dir}"
|
||||
printf "If you want to convert a model again, remove the entire %s folder. %s" "${ir_dir}" "${run_again}"
|
||||
fi
|
||||
|
||||
# Step 4. Build samples
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Build Inference Engine samples\n\n"
|
||||
|
||||
OS_PATH=$(uname -m)
|
||||
@ -207,15 +207,14 @@ cmake -DCMAKE_BUILD_TYPE=Release "$samples_path"
|
||||
make $NUM_THREADS classification_sample_async
|
||||
|
||||
# Step 5. Run samples
|
||||
printf "${dashes}"
|
||||
printf "%s" "${dashes}"
|
||||
printf "Run Inference Engine classification sample\n\n"
|
||||
|
||||
cd "$binaries_dir"
|
||||
|
||||
cp -f "$ROOT_DIR/${model_name}.labels" "${ir_dir}/"
|
||||
|
||||
print_and_run ./classification_sample_async -d "$target" -i "$target_image_path" -m "${ir_dir}/${model_name}.xml" ${sampleoptions}
|
||||
|
||||
printf "${dashes}"
|
||||
print_and_run ./classification_sample_async -d "$target" -i "$target_image_path" -m "${ir_dir}/${model_name}.xml" "${sampleoptions}"
|
||||
|
||||
printf "%s" "${dashes}"
|
||||
printf "Demo completed successfully.\n\n"
|
||||
|
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2018-2021 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
|
@ -6,28 +6,28 @@
|
||||
# This script installs Linux kernel 4.14 required for Intel NEO OpenCL driver on Ubuntu and CentOS
|
||||
|
||||
if grep -i "rhel" /etc/os-release &>/dev/null; then
|
||||
# Cent OS
|
||||
echo "install kernel build dependencies"
|
||||
sudo -E yum install -y git gcc gcc-c++ ncurses-devel openssl-devel bc xz elfutils-libelf-devel xorg-x11-drv-nouveau rpm-build
|
||||
# Cent OS
|
||||
echo "install kernel build dependencies"
|
||||
sudo -E yum install -y git gcc gcc-c++ ncurses-devel openssl-devel bc xz elfutils-libelf-devel xorg-x11-drv-nouveau rpm-build
|
||||
|
||||
echo "download 4.14.20 kernel"
|
||||
if [ ! -f ./linux-4.14.20.tar.xz ]; then
|
||||
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.20.tar.xz
|
||||
fi
|
||||
echo "download 4.14.20 kernel"
|
||||
if [ ! -f ./linux-4.14.20.tar.xz ]; then
|
||||
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.14.20.tar.xz
|
||||
fi
|
||||
|
||||
tar -xJf linux-4.14.20.tar.xz
|
||||
cd linux-4.14.20
|
||||
echo "build 4.14.20 kernel"
|
||||
make olddefconfig
|
||||
tar -xJf linux-4.14.20.tar.xz
|
||||
cd linux-4.14.20
|
||||
echo "build 4.14.20 kernel"
|
||||
make olddefconfig
|
||||
|
||||
make -j 8 binrpm-pkg
|
||||
cd ~/rpmbuild/RPMS/x86_64
|
||||
sudo -E yum -y localinstall *.rpm
|
||||
sudo -E grub2-set-default 0
|
||||
make -j 8 binrpm-pkg
|
||||
cd ~/rpmbuild/RPMS/x86_64
|
||||
sudo -E yum -y localinstall ./*.rpm
|
||||
sudo -E grub2-set-default 0
|
||||
|
||||
elif grep -i "ubuntu" /etc/os-release &>/dev/null; then
|
||||
# Ubuntu
|
||||
sudo -E add-apt-repository ppa:teejee2008/ppa
|
||||
sudo -E apt-get update && sudo apt-get install -y ukuu
|
||||
sudo -E ukuu --install v4.14.20
|
||||
# Ubuntu
|
||||
sudo -E add-apt-repository ppa:teejee2008/ppa
|
||||
sudo -E apt-get update && sudo apt-get install -y ukuu
|
||||
sudo -E ukuu --install v4.14.20
|
||||
fi
|
@ -22,5 +22,3 @@ else
|
||||
echo "File '97-myriad-usbboot.rules' is missing. Please make sure you installed 'Inference Engine Runtime for Intel® Movidius™ VPU'."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user