{"id":21802460,"url":"https://github.com/qengineering/yolov5-npu","last_synced_at":"2025-08-17T14:32:58.785Z","repository":{"id":191363956,"uuid":"684497337","full_name":"Qengineering/YoloV5-NPU","owner":"Qengineering","description":"YoloV5 NPU for the RK3566/68/88","archived":false,"fork":false,"pushed_at":"2024-06-19T13:19:17.000Z","size":108905,"stargazers_count":83,"open_issues_count":4,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-10T14:52:02.143Z","etag":null,"topics":["deep-learning","npu","orange-pi-5","radxa-zero-3-npu","radxa-zero-3w","rk3566","rk3568","rk3588","rk3588s","rknpu","rock-5","rock5c","yolov5","yolov5s"],"latest_commit_sha":null,"homepage":"https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Qengineering.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T08:51:54.000Z","updated_at":"2024-12-09T09:00:53.000Z","dependencies_parsed_at":"2024-01-16T01:26:04.962Z","dependency_job_id":"7a91dd69-c037-43cd-9e77-da4c41b0c577","html_url":"https://github.com/Qengineering/YoloV5-NPU","commit_stats":null,"previous_names":["qengineering/yolov5-npu-rock-5","qengineering/yolov5-npu"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FYoloV5-NPU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FYoloV5-NPU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FYoloV5-NPU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Qengineering%2FYoloV5-NPU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Qengineering","download_url":"https://codeload.github.com/Qengineering/YoloV5-NPU/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230136131,"owners_count":18178812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","npu","orange-pi-5","radxa-zero-3-npu","radxa-zero-3w","rk3566","rk3568","rk3588","rk3588s","rknpu","rock-5","rock5c","yolov5","yolov5s"],"created_at":"2024-11-27T11:28:51.714Z","updated_at":"2024-12-17T15:08:15.597Z","avatar_url":"https://github.com/Qengineering.png","language":"C++","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=CPZTM5BB3FCYL"],"categories":[],"sub_categories":[],"readme":"# YoloV5 NPU\n![output image]( https://qengineering.eu/github/YoloV5_Parking_NPU.webp )\n## YoloV5 for RK3566/68/88 NPU (Rock 5, Orange Pi 5, Radxa Zero 3). \u003cbr/\u003e\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\u003cbr/\u003e\u003cbr/\u003e\nPaper: https://towardsdatascience.com/yolo-v5-is-here-b668ce2a4908\u003cbr/\u003e\u003cbr/\u003e\nSpecial made for the NPU, see [Q-engineering deep learning examples](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html)\n\n------------\n\n## Model performance benchmark (FPS)\n\nAll models, with C++ examples can be found on the SD images.\u003cbr\u003e\u003cbr\u003e\n![output image]( https://qengineering.eu/github/RockPi5_Ubuntu_22.jpg ) [Rock 5 with **Ubuntu 22.04**, OpenCV, ncnn and **NPU**](https://github.com/Qengineering/Rock-5-Ubuntu-22-image)\u003cbr\u003e\u003cbr\u003e\n![output image]( https://qengineering.eu/github/RadxaZero3_Ubuntu_22.jpg ) [Radxa Zero 3 with **Ubuntu 22.04**, OpenCV, ncnn and **NPU**](https://github.com/Qengineering/Radxa-Zero-3-NPU-Ubuntu22)\u003cbr\u003e\u003cbr\u003e\nAll models are quantized to **int8**, unless otherwise noted.\u003cbr\u003e\n\n| demo             | model_name                   | RK3588  | RK3566/68  |\n| ---------------- | ---------------------------- | :-----: | :--------: |\n| yolov5           | yolov5s_relu                 | 50.0    | 14.8       |\n|                  | yolov5n                      | 58.8    | 19.5       |\n|                  | yolov5s                      | 37.7    | 11.7       |\n|                  | yolov5m                      | 16.2    | 5.7        |\n| yolov6           | yolov6n                      | 63.0    | 18.0       |\n|                  | yolov6s                      | 29.5    | 8.1        |\n|                  | yolov6m                      | 15.4    | 4.5        |\n| yolov7           | yolov7-tiny                  | 53.4    | 16.1       |\n|                  | yolov7                       | 9.4     | 3.4        |\n| yolov8           | yolov8n                      | 53.1    | 18.2       |\n|                  | yolov8s                      | 28.5    | 8.9        |\n|                  | yolov8m                      | 12.1    | 4.4        |\n| yolov10          | yolov10n                     | 35.1    | 12.5       |\n|                  | yolov8s                      | 23.4    | 7.3        |\n|                  | yolov8m                      |  9.7    | 3.4        |\n|                  | yolov8x                      |  5.1    | 1.8        |\n| yolox            | yolox_s                      | 30.0    | 10.0       |\n|                  | yolox_m                      | 12.9    | 4.8        |\n| ppyoloe          | ppyoloe_s                    | 28.8    | 9.2        |\n|                  | ppyoloe_m                    | 13.1    | 5.04       |\n| yolov5_seg       | yolov5n-seg                  | 9.4     | 1.04       |\n|                  | yolov5s-seg                  | 7.8     | 0.87       |\n|                  | yolov5m-seg                  | 6.1     | 0.71       |\n| yolov8_seg       | yolov8n-seg                  | 8.9     | 0.91       |\n|                  | yolov8s-seg                  | 7.3     | 0.87       |\n|                  | yolov8m-seg                  | 4.5     | 0.7        |\n| ppseg\t           | ppseg_lite_1024x512          | 27.5    | 2.4        |\n| RetinaFace       | RetinaFace_mobile320\u003csup\u003e1\u003c/sup\u003e    | 243.6   | 88.5       |\n|                  | RetinaFace_resnet50_320\u003csup\u003e1\u003c/sup\u003e | 43.4    | 11.8       |\n| PPOCR-Det        | ppocrv4_det\u003csup\u003e2\u003c/sup\u003e             | 31.5    | 15.1       |\n| PPOCR-Rec        | ppocrv4_rec\u003csup\u003e3\u003c/sup\u003e             | 35.7    | 17.3       |\n\n\u003csup\u003e1\u003c/sup\u003e Input size 320x320\u003cbr\u003e\n\u003csup\u003e2\u003c/sup\u003e Input size 480x480\u003cbr\u003e\n\u003csup\u003e3\u003c/sup\u003e Input size 48x320, FP16\u003cbr\u003e\n* Due to the pixel-wise filling and drawing, segmentation models are relatively slow\n\n------------\n\n## Dependencies.\nTo run the application, you have to:\n- OpenCV 64-bit installed.\n- Optional: Code::Blocks. (```$ sudo apt-get install codeblocks```)\n\n### Installing the dependencies.\nStart with the usual \n```\n$ sudo apt-get update \n$ sudo apt-get upgrade\n$ sudo apt-get install cmake wget curl\n```\n#### OpenCV\nFollow the Raspberry Pi 4 [guide](https://qengineering.eu/install-opencv-on-raspberry-64-os.html).\u003cbr\u003e\n\n#### RKNPU2\n```\n$ git clone https://github.com/airockchip/rknn-toolkit2.git\n```\nWe only use a few files.\n```\nrknn-toolkit2-master\n│      \n└── rknpu2\n    │      \n    └── runtime\n        │       \n        └── Linux\n            │      \n            └── librknn_api\n                ├── aarch64\n                │   └── librknnrt.so\n                └── include\n                    ├── rknn_api.h\n                    ├── rknn_custom_op.h\n                    └── rknn_matmul_api.h\n\n$ cd ~/rknn-toolkit2-master/rknpu2/runtime/Linux/librknn_api/aarch64\n$ sudo cp ./librknnrt.so /usr/local/lib\n$ cd ~/rknn-toolkit2-master/rknpu2/runtime/Linux/librknn_api/include\n$ sudo cp ./rknn_* /usr/local/include\n```\nSave 2 GB of disk space by removing the toolkit. We do not need it anymore.\n```\n$ cd ~\n$ sudo rm -rf ./rknn-toolkit2-master\n```\n\n------------\n\n## Installing the app.\nTo extract and run the network in Code::Blocks \u003cbr/\u003e\n```\n$ mkdir *MyDir* \u003cbr/\u003e\n$ cd *MyDir* \u003cbr/\u003e\n$ git clone https://github.com/Qengineering/YoloV5-NPU.git \u003cbr/\u003e\n```\n\n------------\n\n## Running the app.\nYou can use **Code::Blocks**.\n- Load the project file *.cbp in Code::Blocks.\n- Select _Release_, not Debug.\n- Compile and run with F9.\n- You can alter command line arguments with _Project -\u003e Set programs arguments..._ \n\nOr use **Cmake**.\n```\n$ cd *MyDir*\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make -j4\n```\nMake sure you use the model fitting your system.\u003cbr\u003e\u003cbr\u003e\n\nMore info or if you want to connect a camera to the app, follow the instructions at [Hands-On](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html#HandsOn).\u003cbr/\u003e\u003cbr/\u003e\n![output image]( https://qengineering.eu/github/YoloV5_Bus_NPU.webp )\n\n------------\n\n[![paypal](https://qengineering.eu/images/TipJarSmall4.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=CPZTM5BB3FCYL) \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqengineering%2Fyolov5-npu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqengineering%2Fyolov5-npu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqengineering%2Fyolov5-npu/lists"}