Skip to content

Latest commit

 

History

History
 
 

multi-model

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Multi Model Example

Table of Contents

1 Introduction

This example serves as a practical guide, illustrating the step-by-step procedure for installing the required dependencies and successfully building the demo from the source code。

2 Design Files

.
├── CMakeLists.txt
├── README.md
├── build.bat #easy build script
└── src
    ├── CMakeLists.txt
    ├── app  #ipu_multi_model app source code
    ├── models
    ├── onnx # Onnx dependencies
    ├── processing
    └── util

3 How To Build:

3.1 Requirement

  1. Visual Studio 2019 or 2022 (with Desktop dev c++ )
  2. cmake (version >= 3.26)
  3. python (version >= 3.9) (Recommended for python 3.9.13 64bit)
  4. IPU driver & IPU xclbin reledease >= 20230823

3.2 Clean Cache

When you replace the IPU driver or 1x4.xclbin, you need to clear the cache of the old compiled model, they are located in C:\temp\rd\vaip\.cache, and delete everything under this folder.

3.3 Prepare Conda Env

About how to create conda env please refer to Demo Readme

clone Opencv and Glog

  1. opencv (version=4.6.0)
git clone https://github.com/opencv/opencv.git -b 4.6.0
cd opencv
mkdir mybuild
cd mybuild
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CONFIGURATION_TYPES=Release -A x64 -T host=x64 -G 'Visual Studio 16 2019' '-DCMAKE_INSTALL_PREFIX=C:\Program Files\opencv' '-DCMAKE_PREFIX_PATH=.\opencv' -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_opencv_python3=OFF -DBUILD_WITH_STATIC_CRT=OFF -B build -S ../
cmake --build build --config Release
cmake --install build --config Release
  1. build gflags & glog
git clone https://github.com/gflags/gflags.git
cd gflags
mkdir mybuild
cd mybuild
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CONFIGURATION_TYPES=Release -A x64 -T host=x64 -G 'Visual Studio 17 2022' '-DCMAKE_INSTALL_PREFIX=C:\Program Files\gflag'  -B build -S ../
cmake --build build --config Release
cmake --install build --config Release
cd ../..
git clone https://github.com/google/glog.git
cd glog
mkdir mybuild
cd mybuild
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CONFIGURATION_TYPES=Release -A x64 -T host=x64 -G 'Visual Studio 17 2022' '-DCMAKE_INSTALL_PREFIX=C:\Program Files\glog'  -B build -S ../
cmake --build build --config Release
cmake --install build --config Release

3.4 Install python package

  1. opencv
python3 -m pip install opencv-python
  1. pillow
python3 -m pip install pillow

3.5 Compile the Application

We provide an easy script for compiling and installing the application. After the compilation stage is complete, you will find the executable file generated at bin/ipu_multi_models.exe.

.\build.bat

Output:

    -- Installing: ..../bin/ipu_multi_models.exe

4 Run The Demos(Optional)

If you want to run the demo, please follow the instruction in the multi-model-exec directory.