Horizon Rising Sun X3 Development Board (4) Running process record on self-training model board

1. Preparation

  • onnx 1.5
  • Setup version 10
  • Self-trained darknet model
  • yolov3 darknet to onnx script:
#darknet 转 onnx脚本
链接:https://pan.baidu.com/s/1yzk9iiCR21qCh3Q9r6ybGw 
提取码:f4xx 
  • Copy and rename the yolov3 project
    Insert picture description here
  • Copy the converted onnx model to:
horizon_x3_tc_1.1.17e/samples/01_common/modelzoo/mapper/detection/yolov3/
  • Modify the number and name of classes in the reasoning source code of yolov3_post_process.cc
  • Modify the 9 anchors in the anchor source code, where the parameters in the anchor need to be divided by 8.Insert picture description hereInsert picture description here

2. Check the model

cd 04_yolov3_01/mapper
  • According to the case of yolov5 using the onnx model, modify 01_chack

Insert picture description here

  • Modify the yolov3_config.yaml configuration file

Only modify the model path and model type here
Insert picture description here

sh 01_check.sh 
  • Data calibration
 sh 02_preprocess.sh
  • Model conversion

It is better to have more than 4GB of memory, otherwise there may be insufficient memory when converting the model.

sh 03_build.sh

There is an error here:
Insert picture description here
modify the input location of the model in the yolov3_config.yaml configuration file according to the error: the
Insert picture description here
model_output file will be generated in the directory after the conversion is successful
Insert picture description here

Three. Run on the board

cd runtime_arm
sh 01_build.sh
sh 02_preprocess.sh
#将构建的包发送到开发板下
sh 03_scp_to_board.sh 192.168.124.103
  • The file will be sent to /userdata/samples/
    Insert picture description here

  • SSH development board to run inference scripts

  • Modify the image path of board_test_image in env.conf

cd /userdata/samples/yolov3

sh dev_board_01_infer.sh
  • View inference results

After the inference is over, you can view the output picture under the image_out file.
Insert picture description here
Insert picture description here

Four. Reference

https://developer.horizon.ai/resource
https://developer.horizon.ai/forum/id=5f5f19e8cc8b1e59c8582b0a

Guess you like

Origin blog.csdn.net/djj199301111/article/details/111259024