Fixed shellcheck issues (#6141)

This commit is contained in:
Ilya Lavrenov authored and GitHub committed 2021-06-15 16:29:26 +03:00
1 parent c3d1c2e420
commit b4e6028f8b
8 files changed
+63 -63

No files matched your search

+13 -13
View File
@@ -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"
+10 -10
View File
@@ -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"
+2
View File
@@ -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