Page 1 of 1

Need some hints, thanks a lot!

Posted: 2025-01-14 12:34
by Wei
Hi everyone, I'm a beginner of the luckfox board, need some advice to proceed my project.
Board : luckfox pico mini b (Ubuntu 22.04)
task : training a yolov5 model (dog and cat detection) with my PC and run it on the board (input a "input.mp4" ,output a "output.mp4")
so far I've succeed transfromed my model.pt to model.onnx to model.rknn by using a virtual machine on my PC
Now I want to apply this model.rknn to my board and use it, but I'm not sure what to do to activate the rknn.api or rknn.h on my board (by using python or main.c)
Is rknn-toolkit2 my next step? using rknpu2 inside the toolkit? and I've copy the rknn_server to my board (/usr/bin/)

Really need some help, thank you

Re: Need some hints, thanks a lot!

Posted: 2025-01-15 13:06
by Ryand
You can refer to this link https://wiki.luckfox.com/zh/Luckfox-Pic ... E4% BE% 8B. Although RKNN Model Zoo does not directly support MP4 video files, you can use the RKNN model to infer each frame of the image to generate MP4 inference results

Re: Need some hints, thanks a lot!

Posted: 2025-01-16 5:29
by Wei
Thanks for your reply.
But I'm a little confuse at this step.
The tutorial says to install everything (toolkit2、model_zoo) and convert a model to rknn format in Ubuntu at the PC (done), then send it to the board which has not install anything but only burning image create by the luckfox-pico sdk, how can the board import rknn.api?

Re: Need some hints, thanks a lot!

Posted: 2025-01-16 6:19
by Ryand
Because the generated file contains libraries related to dynamic links, which include the corresponding RKNN API, it seems that the cpp file runs like this after cross compilation.
Snipaste_2025-01-16_14-01-36.png
However, the python file has not been tested yet, and it is possible that the related dependency libraries have not been installed in the development board.

Re: Need some hints, thanks a lot!

Posted: 2025-01-16 7:12
by Wei
I see
So I can just simply run the cpp file generate by model_zoo from my PC on the board by using cmake, since the library is included in the output file of the model_zoo, did I get it right? Cause I have found the librknnmt.so in my /usr/lib/
No need to activate the rknpu2 or something else. (restart_rknn.sh)

Re: Need some hints, thanks a lot!

Posted: 2025-01-17 8:41
by Ryand
The librknnmt.so library file contains the necessary functions for interacting with NPU.