Sample program of Neon-RB5 - Capture and Inference - Model converter
sudo apt-get update
sudo apt install --fix-broken
sudo apt-get install cmake
tar -zxvf Neon-RB5_sample.tar.gz -C /home/adlink/Desktop
cd /home/adlink/Desktop/Neon-RB5_sample
cp /home/adlink/Desktop/Neon-RB5_sample/yolov6n_base_quantized.dlc /home/adlink
tar -zxvf snpe-1.68.0.3932.tar.gz -C /home/adlink
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/adlink/snpe-1.68.0.3932/lib/aarch64-ubuntu-gcc7.5:/usr/local/lib/
export ADSP_LIBRARY_PATH="/home/adlink/snpe-1.68.0.3932/lib/dsp;/usr/lib/rfsa/adsp/;/vendor/lib/rfsa/dsp/testsig;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp"
export PATH=$PATH:/home/adlink/snpe-1.68.0.3932/bin/aarch64-ubuntu-gcc7.5
source ~/.bashrc
cd /home/adlink/Desktop/Neon-RB5_sample/samples
mkdir build && cd build
cmake .. && make
cd /home/adlink/Desktop/Neon-RB5_sample/samples/build
cp ../../yolo.txt .
./yolov6_snpe
- x86 Host PC with [ubuntu18.04](https://releases.ubuntu.com/18.04)
- Neon-RB5
The AI model used in the example is Meituan YOLOv6-N Below, we will describe how to convert the downloaded yolov6n.pt file into a dlc file for use with Neon-RB5.
The model conversion process primarily consists of four steps and requires a host PC with Ubuntu 18.04. Steps 1~5 are executed on the host.
sudo apt-get update && sudo apt-get upgrade
sudo apt install python3-pip -y
pip3 install --upgrade pip
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1
update-alternatives --list python
wget https://sftp.adlinktech.com/image/Neon-RB5/snpe-1.68.0.zip -O ~/snpe-1.68.0.zip
wget https://sftp.adlinktech.com/image/Neon-RB5/YOLOv6.tar.gz ~/YOLOv6.tar.gz
cd ~
unzip -X snpe-1.68.0.zip -d ~
export SNPE_ROOT=/home/adlink/snpe-1.68.0.3932
export PYTHONPATH=$PYTHONPATH:$SNPE_ROOT/lib/python
source $SNPE_ROOT/bin/dependencies.sh
source $SNPE_ROOT/bin/check_python_depends.sh
pip3 install numpy==1.16.5 sphinx==2.2.1 scipy==1.3.1 matplotlib==3.0.3 scikit-image==0.15.0 protobuf==3.6.0 pyyaml==5.1
source snpe-1.68.0.3932/bin/check_python_depends.sh
pip3 install onnx
pip3 install torch
pip3 install onnxsim
cd ~
tar -zxvf YOLOv6.tar.gzcd ~/YOLOv6/
python3 ./deploy/ONNX/export_onnx.py \
--weights ./deploy/ONNX/yolov6n.pt \
--img 288 \
--batch 1
cd ~/snpe-1.68.0.3932/bin/x86_64-linux-clang
./snpe-onnx-to-dlc --input_network ~/YOLOv6/deploy/ONNX/yolov6n.onnx --output_path yolov6n_base_quantized.dlc
Replace *.dlc in /home/adlink/Desktop/Neon-RB5_sample/samples/build
cd /home/adlink/Desktop/Neon-RB5_sample/samples/build
./yolov6_snpe