I’m looking for a Raspberry Pi alternative for a computer vision project. Hoping to run YOLOv8s on-device 640x640 at 15+ FPS.
Would the ROCK 5A 4GB be a good fit for my project? Any other recommendations? Any advice on getting real-time object detection to work well on a Radxa device? tx!
Why would the FPS drop that actual camera stream on 1920x1080 gave 60fps and same shows 20fps with yolov8n. Is it because of OpenCV code or RK3588 NPU?
Probably because the code you have is processing the frames sequentially. To get 60 FPS you need to process frames in parallel and use a pool of YOLO models across all 3 NPU cores.
The link above is demo/code for implementing parallel processing of frames and pooled Model runtime. As for deploying it, it goes approximately as follows;
Make sure RKNN NPU driver is installed dmesg | grep -i rknpu.
Install Go (depends on OS installed, but can be done via APT).
Yeah that code is processing frames sequentially. Also setting the runtime
to 3 cores using RKNN_NPU_CORE_0_1_2 does little as a single YOLO model does not scale over multiple NPU cores well. You need to run multiple of the same Model in a Pool to get maximum performance out of the NPU.
Here is a CPP example that uses multithreading and pool.
I tried using go-rknnlite and it can stream 1080p video at 60 FPS.
It saturates 60% of all three NPU cores, but playback over HTTP is jittery. The performance issues are in the following areas;
Need to stream over wired ethernet connection as Wifi is too slow.
The scaling of video frames from 1920x1080 to the input tensor size of 640x640 uses a lot of CPU resources 80% across all 8 cores of RK3588.
Post processing of YOLOv8 off loads a lot the work to CPU, compared to running YOLOv5 for example.
You will get smoother playback dropping to 720p @ 60 FPS with YOLOv8. Also performance will depend on your application, do you play back locally or need to stream over a network connection?
Tried yesterday, but found lot of build issues with go. Do we have ore-requisite installation steps for go-rknnlite? where to find the NPU load via sysfs or any tool? I’m looking for network stream but first I can develop locally.