03-Linux_NPU_YOLOv5s_Object_Detection

Symbol Explanation

  • SDK$: Refers to the source code path.

  • console$: Generally refers to the command-line console of the motherboard. Mainboard Command-line Console

  • ADB$: Android Debug Bridge command-line tool, generally refers to an environment where ADB can be run.

1. What is NPU YOLOV5S

YOLOV5S is an object detection algorithm in computer vision. It is part of the YOLO (You Only Look Once) series, developed by Joseph Redmon, Alexey Bochkovskiy, and others. The YOLO algorithm series is known for its fast real-time object detection capabilities, which can detect and locate multiple objects in images or videos, including the object's category and position.

YOLOv5S is a variant in the YOLOv5 series. Different versions of YOLOv5 have different performance and model complexities. Usually, the "S" in YOLOv5S may stand for "Small", which means it might be a lightweight model suitable for running in resource-constrained environments, such as mobile devices or embedded systems. YOLOv5S may make a trade-off between speed and accuracy to adapt to different application scenarios.

2. Image and Video Parsing

RK Linux officially provides the rknn_yolov5_demo. The source code supports RK3576. You can download it from the network disk or compile the corresponding tools for image and video parsing.

Network Disk Path

3-SoftwareData/Linux_rknn_yolov5/rknn_yolov5_demo_Linux_rk3576.zip
3-SoftwareData/Linux_rknn_yolov5/yolov5_test.h264

Source Code Path

Source Code Reference and Compilation

Configure the environment.

The toolchain path is (SDk)/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/.

SDK refers to the Linux source code path. For details, see 11-SDK Source Code Compilation.

For example:

rk3576-linux$ pwd

/home/test/rk3576-linux (SDK Linux source code path)

Compile the corresponding tools.

The path of the generated tools.

Copy rknn_yolov5_demo_Linux/ to the motherboard for use.

You need to add execution permissions when running.

​ chmod +x rknn_yolov5_demo

​ chmod +x rknn_yolov5_video_demo

Tool Usage

rknn_yolov5_demo

Example of using rknn_yolov5_demo.

person @ / bus @ are the corresponding recognition information.

The recognized image out.jpg is generated.

yolov5_out

rknn_yolov5_video_demo

Note that you need to use a video with h264/h265 codec stream.

Example of using rknn_yolov5_video_demo.

car @ / bus @ are the corresponding video recognition information.

The recognized video out.h264 is generated.

yolov5_video

Last updated