Please refer to this link: https://github.com/airockchip/rknn_model_zoo/tree/main/models/CV/object_detection/yolo
According to the target platform, modifying the path for Android NDK on 'build-android_.sh'
for example,
ANDROID_NDK_PATH=~/opt/tool_chain/android-ndk-r17
then, running this script:
./build-android_<TARGET_PLATFORM>.sh
Connecting the usb port to PC, then pushing all demo files to the board,
adb root
adb remount
adb push install/rknn_yolov5_demo /data/
adb shell
cd /data/rknn_yolov5_demo/
export LD_LIBRARY_PATH=./lib
./rknn_yolov5_demo model/<TARGET_PLATFORM>/yolov5s-640-640.rknn model/bus.jpg
According to the target platform, modifying the path for 'TOOLCHAIN' on 'build-android.sh'
export TOOL_CHAIN=~/opt/tool_chain/gcc-9.3.0-x86_64_aarch64-linux-gnu/host
then run the script:
./build-linux_<TARGET_PLATFORM>.sh
Push install/rknn_yolov5_demo_Linux to the board,
If using adb via the EVB board:
adb push install/rknn_yolov5_demo_Linux /userdata/
For other boards, using the scp or other different approaches to push all files under install/rknn_yolov5_demo_Linux to '/userdata'
adb shell
cd /userdata/rknn_yolov5_demo_Linux/
export LD_LIBRARY_PATH=./lib
./rknn_yolov5_demo model/<TARGET_PLATFORM>/yolov5s-640-640.rknn model/bus.jpg
Note: Try searching the location of librga.so and add it to LD_LIBRARY_PATH if the librga.so is not found on the lib folder. Using the following commands to add to LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=./lib:<LOCATION_LIBRGA.SO>
H264
./rknn_yolov5_video_demo model/<TARGET_PLATFORM>/yolov5s-640-640.rknn xxx.h264 264
For converting to h264 via the ffmpeg :
ffmpeg -i xxx.mp4 -vcodec h264 out.h264
H265
./rknn_yolov5_video_demo model/<TARGET_PLATFORM>/yolov5s-640-640.rknn xxx.hevc 265
For converting to h265 via the ffmpeg :
ffmpeg -i xxx.mp4 -vcodec hevc out.hevc
RTSP
./rknn_yolov5_video_demo model/<TARGET_PLATFORM>/yolov5s-640-640.rknn <RTSP_URL> 265