AI-Machine-vision
Quick plan with Keywords
=========================
==================================================================
Tele health AI project
---------------------
Principle :
The main objective of the project is to have a tele health system. The whole system is too big to handle by one system. Need to have echo system of
products.
The initial focus is on using core AI models from model library (zoo) and test it on simple images. The open system is supported by Open-vino on windows systems. This require many inputs and outputs analyzed and tested. Windows system require to pre install many tools. These are described in code/schematic section. Simple models used are face recognition , vehicle detection, vehicle parts, type and number plate read tests.
Typical system involves webcam as input device collecting video frames at remote location connected to internet. The image is processed/inferred and results are provided to host locations.
==================================================================
Summary :
Overall plan
System:
* Tele-product-health
Sub system
Tele-product:
* View camera -- at one end
* View screen/analysis -- at other end
Components:
* View camera
* Webcam -- HD
* Components electronics
* WIFI -- connections
* USB connection
* Software - manage/control
* view Screen
* Local computer
* Cloud storage/software
* System management/control
* Update/manage deployments
Local Applications :
General :
* AI/MVI
* Open systems
* Inference - images
* Inference - results
* Models
* Tensor flow
Narrow : Applications : Specific
* Input : images, videos - clips
* input : Public models, local
* Analyze : inference
* Output : inference results
* Output data : results data collections
##================================================
Application : Focus on inference
Common application languages on Windows
* Models
* Python
* scripts
* Shell, python - windows
* Shell, python, c -- linux
* images
* Jpeg, png , bmp
* Videos
* Mp4,mov
Flow : common
* Setup environment
* Check tools
* Organize inputs
* Check formats
* AI component -- inference tool
* Multi steps
* Results
* Outputs - display, files, reports
--------------------------------------------------------------------------------------
Tensor-flow and similar library applications are used to demonstrate the capability of AI on the Tele-health. Focus is on limited scope on AI techniques used in machine/camera vision/images.
Disclaimers and other limitations apply ...etc...
Tele-health is echo system of many applications.
====================================================
PROGRAMMABLE FEATURE : Notes ::
The IOs for different voltage levels of logic.
3.0 v (cell battery) and 5.0 (USB , TTL ) are
managed by programmable logics. Depending upon
the required connection the program code can be
stored in flash device and loaded to SRAM at
boot/execution . If there are FPGAs implemented inside SOC then
It can be programed/reprogrammed by software as needed.
( Answer to programmable feature question at submission )
( included here to prevent loss during submission process/confusions )
=====================================================
..etc.. )
====================================================
Example face detection with percentages :
inputs , outputs , inferences
C/C++Sometimes you have to find different sources for pip,pip3
Need to update PATH variable to find.
====
### collections
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
run
# python get-pip.py
C:\users\other\Anaconda3\python get-pip.py
################# err/debug info ##########
Windows env setup commands
## also
Use gui of windows to set variables
##
languages -- python (for models in tensorflow ) ;; c/c++in other parts..
OPEN SOURCE ...
@echo off
:: Copyright (c) 2018-2020 Intel Corporation
::
:: Licensed under the Apache License, Version 2.0 (the "License");
:: you may not use this file except in compliance with the License.
:: You may obtain a copy of the License at
::
:: http://www.apache.org/licenses/LICENSE-2.0
::
:: Unless required by applicable law or agreed to in writing, software
:: distributed under the License is distributed on an "AS IS" BASIS,
:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
:: See the License for the specific language governing permissions and
:: limitations under the License.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: OPEN SOURCE FOUNDATION ..
:: ###################################################
::
:: Required setups -- Windows 10
:: * setupvars.bat --- sucessful!
:: * pre-install -- Visual studio
:: * visual studio build tools
:: * Python and pip3 install tool ( conda directory ..)
:: * PATH variable update using windows --
:: Edit environment variable command
:: * Repeat if fail -- follow guidance in error message
:: * Good luck
:: ###################################################
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set ROOT=%~dp0
call :GetFullPath "%ROOT%\.." ROOT
set SCRIPT_NAME=%~nx0
set "INTEL_OPENVINO_DIR=%ROOT%"
set "INTEL_CVSDK_DIR=%INTEL_OPENVINO_DIR%"
:: OpenCV
if exist "%INTEL_OPENVINO_DIR%\opencv\setupvars.bat" (
call "%INTEL_OPENVINO_DIR%\opencv\setupvars.bat"
) else (
set "OpenCV_DIR=%INTEL_OPENVINO_DIR%\opencv\x64\vc14\lib"
set "PATH=%INTEL_OPENVINO_DIR%\opencv\x64\vc14\bin;%PATH%"
set "PATH=C:\Users\other\Anaconda3;%PATH%"
)
:: Inference Engine
set "InferenceEngine_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\share"
set "HDDL_INSTALL_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\external\hddl"
set "PATH=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\external\tbb\bin;%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\Release;%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\Debug;%HDDL_INSTALL_DIR%\bin;%PATH%"
if exist %INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\arch_descriptions (
set ARCH_ROOT_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\bin\intel64\arch_descriptions
)
:: nGraph
if exist %INTEL_OPENVINO_DIR%\deployment_tools\ngraph (
set "PATH=%INTEL_OPENVINO_DIR%\deployment_tools\ngraph\lib;%PATH%"
set "ngraph_DIR=%INTEL_OPENVINO_DIR%\deployment_tools\ngraph\cmake"
)
:: Check if Python is installed
python --version 2>NUL
if errorlevel 1 (
echo Error^: Python is not installed. Please install one of Python 3.6 - 3.8 ^(64-bit^) from https://www.python.org/downloads/
exit /B 1
)
:: Check Python version
for /F "tokens=* USEBACKQ" %%F IN (`python --version 2^>^&1`) DO (
set version=%%F
)
for /F "tokens=1,2,3 delims=. " %%a in ("%version%") do (
set Major=%%b
set Minor=%%c
)
if "%Major%" geq "3" (
if "%Minor%" geq "6" (
set python_ver=okay
)
)
if not "%python_ver%"=="okay" (
echo Unsupported Python version. Please install one of Python 3.6 - 3.8 ^(64-bit^) from https://www.python.org/downloads/
exit /B 1
)
:: Check Python bitness
python -c "import sys; print(64 if sys.maxsize > 2**32 else 32)" 2 > NUL
if errorlevel 1 (
echo Error^: Error during installed Python bitness detection
exit /B 1
)
for /F "tokens=* USEBACKQ" %%F IN (`python -c "import sys; print(64 if sys.maxsize > 2**32 else 32)" 2^>^&1`) DO (
set bitness=%%F
)
if not "%bitness%"=="64" (
echo Unsupported Python bitness. Please install one of Python 3.6 - 3.8 ^(64-bit^) from https://www.python.org/downloads/
exit /B 1
)
set PYTHONPATH=%INTEL_OPENVINO_DIR%\python\python%Major%.%Minor%;%INTEL_OPENVINO_DIR%\python\python3;%PYTHONPATH%
if exist %INTEL_OPENVINO_DIR%\deployment_tools\open_model_zoo\tools\accuracy_checker (
set PYTHONPATH=%INTEL_OPENVINO_DIR%\deployment_tools\open_model_zoo\tools\accuracy_checker;%PYTHONPATH%
)
if exist %INTEL_OPENVINO_DIR%\deployment_tools\tools\post_training_optimization_toolkit (
set PYTHONPATH=%INTEL_OPENVINO_DIR%\deployment_tools\tools\post_training_optimization_toolkit;%PYTHONPATH%
)
echo [setupvars.bat] OpenVINO environment initialized
exit /B 0
:GetFullPath
SET %2=%~f1
GOTO :EOF
demo_security_barrier_camera.bat
BatchFile:: Copyright (C) 2018-2019 Intel Corporation
:: SPDX-License-Identifier: Apache-2.0
::
:: OPEN SOURCE FOUNDATION ..
:: ###################################################
::
:: Required setups -- Windows 10
:: * setupvars.bat --- sucessful!
:: * pre-install -- Visual studio
:: * visual studio build tools
:: * Python and pip3 install tool ( conda directory ..)
:: * PATH variable update using windows --
:: Edit environment variable command
:: * Repeat if fail -- follow guidance in error message
:: * Good luck
:: ###################################################
::
::
@echo off
setlocal enabledelayedexpansion
set TARGET=CPU
set SAMPLE_OPTIONS=
set BUILD_FOLDER=%USERPROFILE%\Documents\Intel\OpenVINO
:: command line arguments parsing
:input_arguments_loop
if not "%1"=="" (
if "%1"=="-d" (
set TARGET=%2
echo target = !TARGET!
shift
)
if "%1"=="-sample-options" (
set SAMPLE_OPTIONS=%2 %3 %4 %5 %6
echo sample_options = !SAMPLE_OPTIONS!
shift
)
if "%1"=="-help" (
echo %~n0%~x0 is security barrier camera demo that showcases three models coming with the product
echo.
echo Options:
echo -d name Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD are acceptable. Sample will look for a suitable plugin for device specified
exit /b
)
shift
goto :input_arguments_loop
)
set ROOT_DIR=%~dp0
set target_image_path=%ROOT_DIR%car_1.bmp
set TARGET_PRECISION=FP16
echo target_precision = !TARGET_PRECISION!
if exist "%ROOT_DIR%..\..\bin\setupvars.bat" (
call "%ROOT_DIR%..\..\bin\setupvars.bat"
) else (
echo setupvars.bat is not found, INTEL_OPENVINO_DIR can't be set
goto error
)
echo INTEL_OPENVINO_DIR is set to %INTEL_OPENVINO_DIR%
:: Check if Python is installed
python --version 2>NUL
if errorlevel 1 (
echo Error^: Python is not installed. Please install Python 3.5 ^(64-bit^) or higher from https://www.python.org/downloads/
goto error
)
:: Check if Python version is equal or higher 3.4
for /F "tokens=* USEBACKQ" %%F IN (`python --version 2^>^&1`) DO (
set version=%%F
)
echo %var%
for /F "tokens=1,2,3 delims=. " %%a in ("%version%") do (
set Major=%%b
set Minor=%%c
)
if "%Major%" geq "3" (
if "%Minor%" geq "5" (
set python_ver=okay
)
)
if not "%python_ver%"=="okay" (
echo Unsupported Python version. Please install Python 3.5 ^(64-bit^) or higher from https://www.python.org/downloads/
goto error
)
:: install yaml python modules required for downloader.py
pip3 install --user -r "%ROOT_DIR%..\open_model_zoo\tools\downloader\requirements.in"
if ERRORLEVEL 1 GOTO errorHandling
set models_path=%BUILD_FOLDER%\openvino_models\ir
set models_cache=%BUILD_FOLDER%\openvino_models\cache
if not exist "%models_cache%" (
mkdir "%models_cache%"
)
set downloader_dir=%INTEL_OPENVINO_DIR%\deployment_tools\open_model_zoo\tools\downloader
for /F "tokens=1,2 usebackq" %%a in ("%ROOT_DIR%demo_security_barrier_camera.conf") do (
echo python "%downloader_dir%\downloader.py" --name "%%b" --output_dir "%models_path%" --cache_dir "%models_cache%"
python "%downloader_dir%\downloader.py" --name "%%b" --output_dir "%models_path%" --cache_dir "%models_cache%"
for /F "tokens=* usebackq" %%d in (
`python "%downloader_dir%\info_dumper.py" --name "%%b" ^|
python -c "import sys, json; print(json.load(sys.stdin)[0]['subdirectory'])"`
) do (
set model_args=!model_args! %%a "%models_path%\%%d\%target_precision%\%%b.xml"
)
)
echo.
echo ###############^|^| Generate VS solution for Inference Engine demos using cmake ^|^|###############
echo.
timeout 3
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set "PLATFORM=x64"
) else (
set "PLATFORM=Win32"
)
set VSWHERE="false"
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
set VSWHERE="true"
cd "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
set VSWHERE="true"
cd "%ProgramFiles%\Microsoft Visual Studio\Installer"
) else (
echo "vswhere tool is not found"
)
set MSBUILD_BIN=
set VS_PATH=
if !VSWHERE! == "true" (
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set VS_PATH=%%i
)
if exist "!VS_PATH!\MSBuild\14.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=!VS_PATH!\MSBuild\14.0\Bin\MSBuild.exe"
)
if exist "!VS_PATH!\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=!VS_PATH!\MSBuild\15.0\Bin\MSBuild.exe"
)
if exist "!VS_PATH!\MSBuild\Current\Bin\MSBuild.exe" (
set "MSBUILD_BIN=!VS_PATH!\MSBuild\Current\Bin\MSBuild.exe"
)
)
if "!MSBUILD_BIN!" == "" (
if exist "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=14 2015"
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=15 2017"
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=15 2017"
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=15 2017"
)
) else (
if not "!MSBUILD_BIN:2019=!"=="!MSBUILD_BIN!" set "MSBUILD_VERSION=16 2019"
if not "!MSBUILD_BIN:2017=!"=="!MSBUILD_BIN!" set "MSBUILD_VERSION=15 2017"
if not "!MSBUILD_BIN:2015=!"=="!MSBUILD_BIN!" set "MSBUILD_VERSION=14 2015"
)
if "!MSBUILD_BIN!" == "" (
echo Build tools for Visual Studio 2015 / 2017 / 2019 cannot be found. If you use Visual Studio 2017 / 2019, please download and install build tools from https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017
GOTO errorHandling
)
set "SOLUTION_DIR64=%BUILD_FOLDER%\inference_engine_demos_build"
echo Creating Visual Studio !MSBUILD_VERSION! %PLATFORM% files in %SOLUTION_DIR64%... && ^
if exist "%SOLUTION_DIR64%\CMakeCache.txt" del "%SOLUTION_DIR64%\CMakeCache.txt"
cd "%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\demos" && cmake -E make_directory "%SOLUTION_DIR64%" && cd "%SOLUTION_DIR64%" && cmake -G "Visual Studio !MSBUILD_VERSION!" -A %PLATFORM% "%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\demos"
if ERRORLEVEL 1 GOTO errorHandling
timeout 7
echo.
echo ###############^|^| Build Inference Engine demos using MS Visual Studio (MSBuild.exe) ^|^|###############
echo.
timeout 3
echo "!MSBUILD_BIN!" Demos.sln /p:Configuration=Release /t:security_barrier_camera_demo /clp:ErrorsOnly /m
"!MSBUILD_BIN!" Demos.sln /p:Configuration=Release /t:security_barrier_camera_demo /clp:ErrorsOnly /m
if ERRORLEVEL 1 GOTO errorHandling
timeout 7
:runSample
echo.
echo ###############^|^| Run Inference Engine security barrier camera demo ^|^|###############
echo.
timeout 3
cd "%SOLUTION_DIR64%\intel64\Release"
if not exist security_barrier_camera_demo.exe (
cd "%INTEL_OPENVINO_DIR%\inference_engine\demos\intel64\Release"
echo "%INTEL_OPENVINO_DIR%\inference_engine\demos\intel64\Release\security_barrier_camera_demo.exe" -i "%target_image_path%" %model_args% -d !TARGET! -d_va !TARGET! -d_lpr !TARGET! !SAMPLE_OPTIONS!
)
else (
echo "%SOLUTION_DIR64%\intel64\Release\security_barrier_camera_demo.exe" -i "%target_image_path%" %model_args% -d !TARGET! -d_va !TARGET! -d_lpr !TARGET! !SAMPLE_OPTIONS!
)
security_barrier_camera_demo.exe -i "%target_image_path%" %model_args% ^
-d !TARGET! -d_va !TARGET! -d_lpr !TARGET! !SAMPLE_OPTIONS!
if ERRORLEVEL 1 GOTO errorHandling
echo.
echo ###############^|^| Demo completed successfully ^|^|###############
cd "%ROOT_DIR%"
goto :eof
:errorHandling
echo Error
cd "%ROOT_DIR%"
windows application classification example
PythonThe parameters of a car example picture is listed.
:: Copyright (C) 2018-2019 Intel Corporation
:: SPDX-License-Identifier: Apache-2.0
::
:: OPEN SOFTWARE FOUNDATION
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: OPEN SOURCE FOUNDATION ..
:: ###################################################
::
:: Required setups -- Windows 10
:: * setupvars.bat --- sucessful!
:: * pre-install -- Visual studio
:: * visual studio build tools
:: * Python and pip3 install tool ( conda directory ..)
:: * vswhare installed by python install of latest version
:: * Install Cmake and add location to PATH variable
:: * PATH variable update using windows --
:: Edit environment variable command
:: * Repeat if fail -- follow guidance in error message
::
:: * Good luck
:: ###################################################
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
::
::
@echo off
setlocal enabledelayedexpansion
set TARGET=CPU
set BUILD_FOLDER=%USERPROFILE%\Documents\Intel\OpenVINO
:: command line arguments parsing
:input_arguments_loop
if not "%1"=="" (
if "%1"=="-d" (
set TARGET=%2
echo target = !TARGET!
shift
)
if "%1"=="-sample-options" (
set SAMPLE_OPTIONS=%2 %3 %4 %5 %6
echo sample_options = !SAMPLE_OPTIONS!
shift
)
if "%1"=="-help" (
echo %~n0%~x0 is classification demo using public SqueezeNet topology
echo.
echo Options:
echo -d name Specify the target device to infer on; CPU, GPU, FPGA, HDDL or MYRIAD are acceptable. Sample will look for a suitable plugin for device specified
exit /b
)
shift
goto :input_arguments_loop
)
set ROOT_DIR=%~dp0
set TARGET_PRECISION=FP16
echo target_precision = !TARGET_PRECISION!
set models_path=%BUILD_FOLDER%\openvino_models\models
set models_cache=%BUILD_FOLDER%\openvino_models\cache
set irs_path=%BUILD_FOLDER%\openvino_models\ir
set model_name=squeezenet1.1
set target_image_path=%ROOT_DIR%car.png
if exist "%ROOT_DIR%..\..\bin\setupvars.bat" (
call "%ROOT_DIR%..\..\bin\setupvars.bat"
) else (
echo setupvars.bat is not found, INTEL_OPENVINO_DIR can't be set
goto error
)
echo INTEL_OPENVINO_DIR is set to %INTEL_OPENVINO_DIR%
:: Check if Python is installed
C:\Users\other\Anaconda3\python --version 2>NUL
if errorlevel 1 (
echo Error^: Python is not installed. Please install Python 3.5 ^(64-bit^) or higher from https://www.python.org/downloads/
goto error
)
:: Check if Python version is equal or higher 3.4
for /F "tokens=* USEBACKQ" %%F IN (`python --version 2^>^&1`) DO (
set version=%%F
)
echo %var%
for /F "tokens=1,2,3 delims=. " %%a in ("%version%") do (
set Major=%%b
set Minor=%%c
)
if "%Major%" geq "3" (
if "%Minor%" geq "5" (
set python_ver=okay
)
)
if not "%python_ver%"=="okay" (
echo Unsupported Python version. Please install Python 3.5 ^(64-bit^) or higher from https://www.python.org/downloads/
goto error
)
:: install yaml python modules required for downloader.py
pip3 install --user -r "%ROOT_DIR%..\open_model_zoo\tools\downloader\requirements.in"
if ERRORLEVEL 1 GOTO errorHandling
set downloader_dir=%INTEL_OPENVINO_DIR%\deployment_tools\open_model_zoo\tools\downloader
for /F "tokens=* usebackq" %%d in (
`python "%downloader_dir%\info_dumper.py" --name "%model_name%" ^|
python -c "import sys, json; print(json.load(sys.stdin)[0]['subdirectory'])"`
) do (
set model_dir=%%d
)
set ir_dir=%irs_path%\%model_dir%\%target_precision%
echo Download public %model_name% model
echo python "%downloader_dir%\downloader.py" --name "%model_name%" --output_dir "%models_path%" --cache_dir "%models_cache%"
python "%downloader_dir%\downloader.py" --name "%model_name%" --output_dir "%models_path%" --cache_dir "%models_cache%"
echo %model_name% model downloading completed
timeout 7
if exist "%ir_dir%" (
echo.
echo Target folder %ir_dir% already exists. Skipping IR generation with Model Optimizer.
echo If you want to convert a model again, remove the entire %ir_dir% folder.
timeout 7
GOTO buildSample
)
echo.
echo ###############^|^| Install Model Optimizer prerequisites ^|^|###############
echo.
timeout 3
cd "%INTEL_OPENVINO_DIR%\deployment_tools\model_optimizer\install_prerequisites"
call install_prerequisites_caffe.bat
if ERRORLEVEL 1 GOTO errorHandling
timeout 7
echo.
echo ###############^|^| Run Model Optimizer ^|^|###############
echo.
timeout 3
::set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
echo python "%downloader_dir%\converter.py" --mo "%INTEL_OPENVINO_DIR%\deployment_tools\model_optimizer\mo.py" --name "%model_name%" -d "%models_path%" -o "%irs_path%" --precisions "%TARGET_PRECISION%"
python "%downloader_dir%\converter.py" --mo "%INTEL_OPENVINO_DIR%\deployment_tools\model_optimizer\mo.py" --name "%model_name%" -d "%models_path%" -o "%irs_path%" --precisions "%TARGET_PRECISION%"
if ERRORLEVEL 1 GOTO errorHandling
timeout 7
:buildSample
echo.
echo ###############^|^| Generate VS solution for Inference Engine samples using cmake ^|^|###############
echo.
timeout 3
if "%PROCESSOR_ARCHITECTURE%" == "AMD64" (
set "PLATFORM=x64"
) else (
set "PLATFORM=Win32"
)
set VSWHERE="false"
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
set VSWHERE="true"
cd "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer"
) else if exist "%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe" (
set VSWHERE="true"
cd "%ProgramFiles%\Microsoft Visual Studio\Installer"
) else (
echo "vswhere tool is not found"
)
set MSBUILD_BIN=
set VS_PATH=
if !VSWHERE! == "true" (
for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set VS_PATH=%%i
)
if exist "!VS_PATH!\MSBuild\14.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=!VS_PATH!\MSBuild\14.0\Bin\MSBuild.exe"
)
if exist "!VS_PATH!\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=!VS_PATH!\MSBuild\15.0\Bin\MSBuild.exe"
)
if exist "!VS_PATH!\MSBuild\Current\Bin\MSBuild.exe" (
set "MSBUILD_BIN=!VS_PATH!\MSBuild\Current\Bin\MSBuild.exe"
)
)
if "!MSBUILD_BIN!" == "" (
if exist "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=14 2015"
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=15 2017"
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=15 2017"
)
if exist "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" (
set "MSBUILD_BIN=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe"
set "MSBUILD_VERSION=15 2017"
)
) else (
if not "!MSBUILD_BIN:2019=!"=="!MSBUILD_BIN!" set "MSBUILD_VERSION=16 2019"
if not "!MSBUILD_BIN:2017=!"=="!MSBUILD_BIN!" set "MSBUILD_VERSION=15 2017"
if not "!MSBUILD_BIN:2015=!"=="!MSBUILD_BIN!" set "MSBUILD_VERSION=14 2015"
)
if "!MSBUILD_BIN!" == "" (
echo Build tools for Visual Studio 2015 / 2017 / 2019 cannot be found. If you use Visual Studio 2017, please download and install build tools from https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017
GOTO errorHandling
)
set "SOLUTION_DIR64=%BUILD_FOLDER%\inference_engine_samples_build"
echo Creating Visual Studio !MSBUILD_VERSION! %PLATFORM% files in %SOLUTION_DIR64%... && ^
if exist "%SOLUTION_DIR64%\CMakeCache.txt" del "%SOLUTION_DIR64%\CMakeCache.txt"
cd "%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\samples\cpp" && cmake -E make_directory "%SOLUTION_DIR64%" && cd "%SOLUTION_DIR64%" && cmake -G "Visual Studio !MSBUILD_VERSION!" -A %PLATFORM% "%INTEL_OPENVINO_DIR%\deployment_tools\inference_engine\samples\cpp"
if ERRORLEVEL 1 GOTO errorHandling
timeout 7
echo.
echo ###############^|^| Build Inference Engine samples using MS Visual Studio (MSBuild.exe) ^|^|###############
echo.
timeout 3
echo "!MSBUILD_BIN!" Samples.sln /p:Configuration=Release /t:cpp_samples\classification_sample_async /clp:ErrorsOnly /m
"!MSBUILD_BIN!" Samples.sln /p:Configuration=Release /t:cpp_samples\classification_sample_async /clp:ErrorsOnly /m
if ERRORLEVEL 1 GOTO errorHandling
timeout 7
:runSample
echo.
echo ###############^|^| Run Inference Engine classification sample ^|^|###############
echo.
timeout 3
copy /Y "%ROOT_DIR%%model_name%.labels" "%ir_dir%"
cd "%SOLUTION_DIR64%\intel64\Release"
if not exist classification_sample_async.exe (
cd "%INTEL_OPENVINO_DIR%\inference_engine\samples\cpp\intel64\Release"
)
echo classification_sample_async.exe -i "%target_image_path%" -m "%ir_dir%\%model_name%.xml" -d !TARGET! !SAMPLE_OPTIONS!
classification_sample_async.exe -i "%target_image_path%" -m "%ir_dir%\%model_name%.xml" -d !TARGET! !SAMPLE_OPTIONS!
if ERRORLEVEL 1 GOTO errorHandling
echo.
echo ###############^|^| Classification demo completed successfully ^|^|###############
timeout 10
cd "%ROOT_DIR%"
goto :eof
:errorHandling
echo Error
cd "%ROOT_DIR%"
MAIN README INSTRUCTIONS
=============================================================
=============================================================
Use openvino install kit
==========================
This is the main inferencing tool supporting multiple models.
Tensorflow is also supported.
Following is for testing on windows.
(It supports Ubantu linux also)
==================
run setvars.bat
find paths for tools
==================
notes :
install required tools
* visual studio
* cmake
* vsWhere
https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017
vsWhere :
latest visual studio installs vsWhere :
https://visualstudio.microsoft.com/vs/preview/
# make sure - at path below
C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
cmake.org web site
cmake -- use installer for installing
Install build tools also :
At the website little below - scroll down and find them
There are multiple packages. Pick most of them.
============================================
update path variable in the control system
search -- environment variable edit
popup box appear
select path and EDIT
==============
ctrl-shift-c --- copy from command window or cloud
.......-v --- to paste
=========================================================
=========================================================
To check the correctness of installation and setup run the
following batch file. Look for successful completion.
demo_squeezenet_download_convert_run.bat
Next run the batch file for detecting car and number plate.
demo_security_barrier_camera
At the end you should see the graphics display of the car with results
input car_1 :: should be a bmp file
==========================================================
==========================================================
SUMMARY ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: OPEN SOURCE FOUNDATION ..
:: ###################################################
::
:: Required setups -- Windows 10
:: * setupvars.bat --- sucessful!
:: * pre-install -- Visual studio
:: * visual studio build tools
:: * Python and pip3 install tool ( conda directory ..)
:: * vswhare installed by python install of latest version
:: * Install Cmake and add location to PATH variable
:: * PATH variable update using windows --
:: Edit environment variable command
:: * Repeat if fail -- follow guidance in error message
::
:: * Good luck
:: ###################################################
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
::
::
README file
=====================================================
Demo Scripts for Model Optimizer and Inference Engine
=====================================================
::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: OPEN SOURCE FOUNDATION ..
:: ###################################################
::
:: Required setups -- Windows 10
:: * setupvars.bat --- sucessful!
:: * pre-install -- Visual studio
:: * visual studio build tools
:: * Python and pip3 install tool ( conda directory ..)
:: * PATH variable update using windows --
:: Edit environment variable command
:: * Repeat if fail -- follow guidance in error message
:: * Good luck
:: ###################################################
::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
The demo scripts illustrate Intel(R) Deep Learning Deployment
Toolkit usage to convert and optimize pre-trained models and perform inference.
Setting Up Demos
================
If you are behind a proxy, set the following environment variables in the console session:
On Linux* and Mac OS:
export http_proxy=http://<proxyHost>:<proxyPort>
export https_proxy=https://<proxyHost>:<proxyPort>
On Windows* OS:
set http_proxy=http://<proxyHost>:<proxyPort>
set https_proxy=https://<proxyHost>:<proxyPort>
Running Demos
=============
The "demo" folder contains three scripts:
1. Classification demo using public SqueezeNet topology (demo_squeezenet_download_convert_run.sh|bat)
./demo_squeezenet_download_convert_run.sh
The script allows to specify the target device to infer on using -d <CPU|GPU|MYRIAD|FPGA> option.
Classification Demo Using SqueezeNet
====================================
The demo illustrates the general workflow of using the Intel(R) Deep Learning Deployment Toolkit
and performs the following:
- Downloads a public SqueezeNet model using the Model Downloader
(open_model_zoo\tools\downloader\downloader.py)
- Installs all prerequisites required for running the Model Optimizer using the scripts from
the "model_optimizer\install_prerequisites" folder
- Converts SqueezeNet to an IR using the Model Optimizer (model_optimizer\mo.py) via the Model
Converter (open_model_zoo\tools\downloader\converter.py)
- Builds the Inference Engine classification_sample (inference_engine\samples\classification_sample)
- Runs the sample with the car.png picture located in the demo folder
The sample application prints top-10 inference results for the picture.
For more information about the Inference Engine classification sample, refer to the documentation
available in the sample folder.
##################### ++++++++++++++++++ =========================
## May need some manual debug of Windows setup and tools
## tools,python,packages ...
##
##################################################################
Comments