Sign inSign up

arcturusnetworks/rknn-toolkit2

By arcturusnetworks

•Updated over 2 years ago

Image
0

316

arcturusnetworks/rknn-toolkit2 repository overview

⁠Quickstart

Pull docker image and start a container

docker run -it --rm -v <path/to/folder/that/contains/pt/model>:/models arcturusnetworks/rknn-toolkit2:1.5.0

Convert *.pt to *.onnx

cd yolov5 && python3 export.py --rknpu --imgsz 360 640  --weight /models/y5s-aceage-20240402-640x360-combined.pt

Convert *.onnx to *.rknn

cd /src/examples/onnx/yolov5/ && python3 convert.py -i /models/y5s-aceage-20240402-640x360-combined.onnx

⁠Updating Anchors

When converting from .pt to .onnx, a new file named yolov5/RK_anchors.txt is generated. For example,

$ cat RK_anchors.txt
227.0
22.9375
322.75
23.453125
260.5
32.75
333.75
31.0625
308.5
38.09375
292.5
46.65625
362.5
39.0
354.75
46.21875
352.75
54.9375

Modify the anchors in rknpu2/examples/rknn_yolov5_android_apk_demo/app/src/main/cpp/post_process.cc with the ones from file above (round them to the nearest integer),

    int anchor0[6] = {227, 23, 323, 23, 261, 33};
    int anchor1[6] = {334, 31, 309, 38, 293, 47};
    int anchor2[6] = {363, 39, 355, 46, 353, 55};

Tag summary

Content type

Image

Digest

sha256:c741bdaf6…

Size

6.3 GB

Last updated

over 2 years ago

docker pull arcturusnetworks/rknn-toolkit2:1.5.0