YOLOv8部署全流程

yolov8数据标注、模型训练到模型部署全过程 yolov8进行自己的数据标注、模型训练以及模型部署全过程 阅读详情

注意,本教程使用的是现成的已经转化好的rknn格式模型,后续会写pt—onnx—rknn的教程

1. 硬件购买

1.1 开发板

本教程使用RV1126开发板进行部署,某鱼200不到的价格,这个板子是我找到带NPU比较便宜的板子了,适合入门尝试。

注意购买的时候看准是开发板,不是核心板,核心板只有一个接口,开发板有很多接口。

板卡自行搜索购买,我不做推销。

这里二手的板卡可能需要自己买个12v 1A左右的电源(或者家里路由器的电源就可以)

1.2 摄像头

普通USB摄像头即可

2. 软件准备

本教程提供所有需要的软件包,不需要再费时到处寻找下载了

2.1 板卡烧录系统

(1)自己电脑(Windows)安装驱动DriverAssitant_v5.0

运行文件:yolov8部署全过程用到的包\1.1win 驱动DriverAssitant_v5.0\DriverInstall.exe

部分系统需要重启电脑才能生效

(2)首先要确认看门狗被关闭(出厂默认关闭,用户会按需自行开启),否则会一进入Loader模式就会马上重启。

(3)给板卡烧录系统

Android-USB线,连接板卡和电脑

运行文件:yolov8部署全过程用到的包\1.2win 固件(板卡系统)EASY-EAI-Nano-Ubuntu-20.04-firmware_20240227\tools\windows\RKDevTool\RKDevTool_Release\RKDevTool.exe

如果烧录工具启动正常,则会看到以下界面:

点击【切换】按钮,等待10秒左右,切换到Loader模式(此方法切换失败的话,则可以采用手动方式进入Loader模式)。

然后点击【执行】按钮,烧录成功如下所示

到此就完成了板卡的系统烧录。

后续所有步骤都在虚拟机进行

2.2 安装虚拟机

运行文件:yolov8部署全过程用到的包\1.3win 虚拟机\VMware-workstation-full-16.2.2-19200509.exe

安装虚拟机,并选择 yolov8部署全过程用到的包\1.3win 虚拟机\ubuntu-20.04.6-desktop-amd64.iso 作为虚拟机系统,其他的选项默认,内存大一点60G差不多

安装过程时间较长,耐心等待。

2.3 安装docker

更新 apt 包索引

sudo apt-get update
sudo apt upgrade

安装 apt 依赖包,用于通过HTTPS来获取仓库

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    gnupg-agent \
    software-properties-common \
    lsb-release

添加 Docker 的官方 GPG 密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

设置仓库

sudo add-apt-repository \
   "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/ \
  $(lsb_release -cs) \
  stable"

更新 apt 包索引

sudo apt-get update
sudo apt upgrade

安装 Docker Engine-Community 和 containerd

sudo apt-get install docker-ce docker-ce-cli containerd.io

docker更换镜像源

sudo vi /etc/docker/daemon.json

填入以下内容并保存(按 'i' 进入输入模式,按 'Esc' 退出输入模式,输入 ':wq!' 保存):

{
    "registry-mirrors": [
        "https://registry.docker-cn.com",
        "http://hub-mirror.c.163.com",
        "https://dockerproxy.com",
        "https://docker.mirrors.ustc.edu.cn",
        "https://docker.nju.edu.cn"
    ]
}

重新加载配置文件、重启docker

sudo systemctl daemon-reload
sudo systemctl restart docker

2.4 环境配置

(1)将 yolov8部署全过程用到的包\1.5ubuntu 编译环境部署包\rv1126-develop-20240713.tar.gz 放到虚拟机的 home 文件夹下,不用解压

(2)打开命令行终端,加载镜像:

docker load --input rv1126-develop-20240713.tar.gz

上面这个命令只有第一次配置需要,可以用命令 doker images 查看是否已经存在镜像,已存在则直接跳下一步

 (3)编译环境配置

yolov8部署全过程用到的包\3 部署包\develop_environment_20240123.tar.gz 放到虚拟机 home 文件夹下,需要解压

手动解压或者用命令:

tar -xvf develop_environment.tar.gz

到此所有软件环境都准备就绪,虚拟机中所放置的文件如下:

3. 开始编译代码

(第一次配置好环境后,以后都从这一步开始即可,不用重新走1.和2.)

3.1 连接板卡

先将板卡连接到电脑,弹出提示选择连接到虚拟机

连接板卡前:

连接板卡后:

3.2 启动交叉编译环境

cd develop_environment
./run.sh -v /home:/opt

成功如下图:

3.2 编译代码

cd /opt/yolov8_detect_C_demo
./build.sh

成功如下图,中间如果有乱七八糟的不用管,只要不是红色报错就没问题:

3.3 将编译好的程序移植到板卡上

cp /opt/yolov8_detect_C_demo/yolov8_detect_demo_release/ /mnt/userdata/ -rf

耐心等待复制,光标会卡住不动,跳到下一行就是复制完成:

完成后即可关闭终端

4. 运行代码

4.1 进入板卡

打开终端,输入:

adb shell

成功如图:

4.2 开始运行程序

进入板卡后,定位到程序上传的位置,如下所示:  

cd /userdata/yolov8_detect_demo_release

运行程序命令如下所示,以下示例是摄像头推理:  

./yolov8_detect_demo yolov8m_rv1126.rknn /dev/video45

YOLOv8n 模型部署 RK3588 全流程 本文介绍了在Windows系统上训练YOLOv8目标检测模型并将其部署到RK3588芯片的全流程。主要内容包括:1) Windows环境下通过Miniconda搭建PyTorch训练环境;2) 使用Ultralytics库训练得到.pt模型;3) 在Ubuntu系统下将PyTorch模型转换为ONNX格式;4) 通过RKNN-Toolkit2工具链将ONNX模型转换为RK3588专用的.rknn格式;5) 在RK3588开发板上部署RKNN模型,支持图片、视频和RTSP实时流推理。 阅读详情

相关推荐

YOLOv8工业落地全流程:从模型理解到RK3588/RV1126边缘部署实战

这类项目最值得先看的不是功能列表,而是能不能在普通环境里稳定跑起来。YOLOv8 作为当前工业视觉检测的热门选择,很多团队卡在从“跑通Demo”到“产线稳定运行”的最后一公里。这篇文章不绕弯子,直接拆解从网络结构理解、环境配置、数据集准备、模型训练调优,到最终在边缘设备(如 RK3588、RV1126)上部署加速的全流程。如果你正在评估 YOLOv8 是否适合你的项目,或者已经训练了模型但部署时遇到性能、精度或稳定性问题,下面的内容会帮你理清关键路径和避坑点。 我更建议把第一次落地尝试拆成三步:先看懂模型输

weixin_33624741的博客 417

K230实战:YOLOv8模型量化与部署全流程解析

本文详细解析了在K230开发板上部署YOLOv8目标检测模型的全流程,包括环境搭建、模型转换、量化配置与精度调优。重点介绍了使用nncase工具链将ONNX模型转换为kmodel格式的实战技巧,以及边缘端推理优化策略,帮助开发者高效实现AI模型在嵌入式设备的部署。

sql99的博客 704

YOLOv8移动端部署全流程:从模型量化到安卓集成实战

目标检测是计算机视觉的核心任务之一,旨在识别图像中的物体并定位其位置。其原理通常基于深度学习模型,通过卷积神经网络提取特征并预测边界框与类别。这项技术的价值在于为各类应用提供自动化、智能化的视觉感知能力。在应用场景上,目标检测已广泛渗透到安防监控、自动驾驶、工业质检及移动设备交互中。随着边缘计算和端侧智能的发展,如何在资源受限的移动设备上实现高效、低功耗的实时目标检测成为关键挑战。这涉及到模型轻量化、推理引擎适配和性能优化等工程实践。本文聚焦于将先进的YOLOv8模型部署到移动端,详细解析了通过模型剪枝、知

weixin_29056101的博客 266

yolov8实战第一天——yolov8部署并训练自己的数据集(保姆式教程)

YOLOv8是一种基于深度神经网络的目标检测算法,它是YOLO(You Only Look Once)系列目标检测算法的最新版本。YOLOv8的主要改进包括:更高的检测精度:通过引入更深的卷积神经网络和更多的特征层,YOLOv8可以在保持实时性的同时提高检测精度。更快的检测速度:通过对模型进行优化,YOLOv8可以在不降低检测精度的情况下提高检测速度。支持更多的检测任务:除了传统的物体检测任务之外,YOLOv8还支持人脸检测、车辆检测等更多的检测任务。

qq_34717531的博客 7万+

YOLOv8初体验:检测、跟踪、模型部署

YOLOv8初体验:检测、跟踪、模型部署

DeepDriving 7454

C++ ONNX Runtime 部署 YOLOv8 全流程实战

YOLOv8 是当前主流的 anchor-free 实时目标检测模型,其 ONNX 推理需严格匹配预处理(letterbox、归一化)、模型结构(三尺度输出、proto 分割头)与后处理(sigmoid 解码、自研 NMS)。ONNX Runtime 作为跨平台高性能推理引擎,支持 C++ 原生部署,但要求 opset 17 兼容性、静态链接规避 DLL 依赖、显式内存管理及 stride-aware 坐标还原。该技术广泛应用于工业视觉、边缘设备与低延迟嵌入式系统,尤其适合替代 OpenCV DNN 模块或

weixin_29057163的博客 159

仿人型机械臂逆运动学避坑指南:当末端三关节平行时如何处理奇异点

本文深入探讨了6R仿人型机械臂在末三轴平行结构下的逆运动学求解策略,重点分析了运动学逆解中的奇异点问题及其处理方法。通过MATLAB实现展示了D-H参数建模、几何解析法求解流程以及奇异点规避策略,为工业机器人开发提供了实用的数值算法方案和工程优化技巧。

sss66的博客 876

39-OpenLayers多图层切换显示隐藏,支持多个Layer同时显示和隐藏,OpenLayers懒加载瓦片

39-OpenLayers多图层切换显示隐藏,支持多个Layer同时显示和隐藏,OpenLayers懒加载瓦片

fxshy的博客 455

Fiori Elements Analytical List Page 标题区配置全攻略:从变体、过滤模式到 UI.KPI 的工程化落地

ALP标题区是Fiori Elements Analytical List Page的核心交互区域,承担变体管理、过滤模式切换、KPI展示等关键功能。本文系统解析了标题区的组成结构、可用能力及工程实现要点,包括:1)标题区包含过滤类型切换、全局KPI、变体管理等交互元素;2)详细说明视觉过滤与紧凑过滤的同步规则及实现方式;3)介绍OData V2下通过UI.KPI注解配置标题区KPI的方法;4)提供manifest.json配置示例和CDS注解写法。文章还对比了V2与V4版本的差异,为ALP开发提供实用指导

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 239

FPGA控制AD5754实现模数转换Verilog代码与测试激励

本文提供了使用FPGA控制AD5754芯片实现数字信号转模拟信号的Verilog代码和测试激励。AD5754芯片简介:AD5754是一款16位数字信号转模拟信号的芯片。通信方式:FPGA与AD5754之间通过SPI接口进行通信,SPI时钟clk的最大频率为30MHz。模拟输出:AD5754提供了四路模拟输出。工作方式:当前AD5754采用单极性工作方式。指令刷新:根据现有理解,同轴的速度和电流指令应同时刷新。利用LDAC引脚控制模拟信号的刷新,但需实际验证。CLR信号验证。

whm128的博客 241

wxComboBox类的使用方法及示例代码

其中,parent表示该控件的父窗口,ID_COMBOBOX是该控件的ID,用于在事件处理函数中区分不同的控件,"默认选项"是下拉列表框的默认选项,options是wxArrayString类型的数组,用于存储下拉列表框中的选项,style可以指定wxComboBox的样式。wxComboBox是wxWidgets中的一个常用控件,它可以被用来显示一组在下拉列表框中的选项,并允许用户从中选择一个选项。上述就是wxComboBox类的基本使用方法,使用这个控件可以方便地实现下拉列表框的功能。

学习使你进步。 706

【深度学习新浪潮】什么是system 1和system 2?

System 1(快速生成)指大模型直接基于输入生成响应,无需显式中间推理步骤。例如,GPT-4等模型在默认状态下通过Transformer直接输出结果,擅长快速回答简单问题或生成连贯文本,但在复杂逻辑任务中可能出错。这类模型的内部计算以向量形式隐式进行,难以处理符号推理等需要离散决策的任务。System 2(慢速推理)指模型通过生成中间token(如思维链、分步推导)或多次调用LLM进行复杂推理。

专注:太空算力、AI infra、异构调度、大模型成本工程 915

使用LSTM实现自动调制识别(RML2018.01a)

目录一、LSTM的代码实现1.1 导入包1.2 数据读取及数据集划分1.3 数据预处理1.4 构建LSTM模型 本文基于RML2018.01a大型数据集,给出LSTM的信号识别的实现方式(附代码) RML2018.01a数据集信息如下: 模型 传送门 CNN/ResNet 使用CNN/ResNet实现自动调制识别(RML2018.01a) LSTM 使用LSTM实现自动调制识别(RML2018.01a)) 一、LSTM的代码实现 1.1 导入包 import numpy as np

QAQIknow的博客 6113

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: YOLO报错No module named ‘ultralytics‘
下一篇: YOLO模型格式转换:pt -> onnx -> rknn
Dneccc
博客等级 码龄6年 1689粉丝 41原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Dneccc

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值