1 Star 0 Fork 0

code_cso / yolov9_rknn_Cplusplus

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
BSD-3-Clause

yolov9_rknn_Cplusplus

yolov9 瑞芯微 rknn 板端 C++部署,使用平台 rk3588。模型转换参考 【yolov9 瑞芯微芯片rknn部署、地平线芯片Horizon部署、TensorRT部署】

模型文件比较大存放路径【rknn模型链接】

编译和运行

1)编译

cd examples/rknn_yolov9_demo_dfl_open

bash build-linux_RK3588.sh

2)运行

cd install/rknn_yolov9_demo_dfl_open

./rknn_yolov8_demo

注意:修改模型、测试图像、保存图像的路径,修改文件为src下的main.cc


int main(int argc, char **argv)
{
    char model_path[256] = "/home/zhangqian/rknn/rknpu2_1.4.0/examples/rknn_yolov9_demo_dfl_open/model/RK3588/yolov9_relu_80class_zq.rknn";
    char image_path[256] = "/home/zhangqian/rknn/rknpu2_1.4.0/examples/rknn_yolov9_demo_dfl_open/test.jpg";
    char save_image_path[256] = "/home/zhangqian/rknn/rknpu2_1.4.0/examples/rknn_yolov9_demo_dfl_open/test_result.jpg";

    detect(model_path, image_path, save_image_path);
    return 0;
}

测试效果

冒号“:”前的数子是coco的80类对应的类别,后面的浮点数是目标得分。(类别:得分)

images

说明:训练代码参考官方开源的yolov9训练代码,考虑到有些板端对SiLU的支持有限,本示例训练前把激活函数SiLU替换成了ReLU,训练使用的模型配置文件是yolov9.yaml,输入分辨率640x640。用 from thop import profile 统计的模型计算量和参数 Flops: 120081612800.0(120G),Params: 55388336.0(55M)

把板端模型推理和后处理时耗也附上供参考,使用的芯片rk3588,模型输入640x640,检测类别80类。

17090077736846

// Copyright 2020 Rockchip Electronics Co.,Ltd. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE.

About

No description expand collapse
C++ and 3 more languages
BSD-3-Clause
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
C++
1
https://gitee.com/code_cso/yolov9_rknn_Cplusplus.git
git@gitee.com:code_cso/yolov9_rknn_Cplusplus.git
code_cso
yolov9_rknn_Cplusplus
yolov9_rknn_Cplusplus
main

Search