[发疯毕设日志]用labelimg标注数据集、用yolov5n模型进行训练检测工地人员安全情况 day3

yoloV5模型中,x,s,n,m,l分别有什么不同 YOLOv5 的不同变体(如 YOLOv5s、YOLOv5m、YOLOv5l、YOLOv5x 和 YOLOv5n)表示不同大小和复杂性的模型。这些变体在速度和准确度之间提供了不同的权衡,以适应不同的计算能力和实时性需求。适用于需要极高准确度的任务,且具有强大计算能力(如 GPU)的设备。YOLOv5n 在保持较快速度的同时,提供适用于边缘设备的准确度。YOLOv5m 在速度和准确度之间提供了较好的平衡,适用于具有一定计算能力的设备。在选择合适的模型时,主要考虑设备的计算能力和任务对准确度的要求。 阅读详情

8:07 到达战场

Yolov5训练自定义数据

1.标注图片

使用labelimg等标注工具

yolo格式标签

上图显示的zidane.text文件的各个数据的意思如下

以第一行为例

0 表示该识别出的物体的类别

0.48....0.63....表示识别出的物体的外框的中心点在整个图片中的相对位置

0.69.....0.71....表示该物体所对应的外框的长宽

准备训练

在开始训练时要注意,yolov5文件夹必须与datasets文件夹同级

就是他俩得放一起贴贴。

然后在yolov5里边找到data->coco128.yaml

复制它在粘贴原来的位置,复制品叫coco128-副本.yaml

然后把复制品改个名字

然后把

1. path改成存放数据集的images和labels的文件名CHV_dataset的路径

2,把train换成images文件里train的路径

3.把val换成images文件里val的路径

4.test同理,但也可以不选

选择合适的模型进行训练

选择yolov5n模型,因为它比较轻量化

同样在yolov5文件夹里找到models->yolov5n

复制它然后生成副本,改副本名字

打开副本

把副本中的nc=80改成nc=6(我自己的类别是6,你可以根据你的任务进行调整)

训练

在yolov5文件下新建一个weights文件

从yolov5官网下载几个模型


python .\train.py --data .\data\coco_chv.yaml --cfg .\models\yolov5n_chv.yaml --weights
.\weights\yolov5n.pt --batch-size 20 --epochs 120 --workers 4 --name base_n --project
yolo_test
# yolov5s
python .\train.py --data .\data\coco_chv.yaml --cfg .\models\yolov5s_chv.yaml --weights
.\weights\yolov5s.pt --batch-size 16 --epochs 120 --workers 4 --name base_s --project
yolo_test
# yolov5m
python .\train.py --data .\data\coco_chv.yaml --cfg .\models\yolov5m_chv.yaml --weights
.\weights\yolov5m.pt --batch-size 12 --epochs 120 --workers 4 --name base_m --project
yolo_test
# yolov5n6 1280
python .\train.py --data .\data\coco_chv.yaml --img-size 1280 --cfg
.\models\yolov5n6_chv.yaml --weights .\weights\yolov5n6.pt --batch-size 20 --epochs 120
--workers 4 --name base_n6 --project yolo_test

使用labelImg制作数据集并用于YOLOV5模型训练 LabelImg是图形图像注释工具。它是用Python编写的,并将Qt用于其图形界面。目前LabelImg支持YOLO和PascalVOC2种格式,前者标签文件后缀是.txt件,而后者标签文件后缀是.xml件。YOLOv5算法所支持的数据格式为YOLO。图片和保存标签的文件名是对应的,只是扩展名不同例如:00001.txt和00001.jpg)。标签保存在对应的labels文件夹下,与images中的图片文件名一一对应。 阅读详情

相关推荐

YOLOv5基础 | 万字长文带你深度解析yolov5s.yaml配置文件

万字长文帮你深度解析YOLOv5算法之yolov5s.yaml配置文件,小白必学!

小哥谈 6168

基于YOLOv5系列【n/s/m/l】模型开发构建人体手势目标检测识别分析系统

基于YOLOv5系列【n/s/m/l】模型开发构建人体手势目标检测识别分析系统

Together_CZ的博客 5071

YOLO目标检测——工地安全帽手套数据集【含对应voc、coco和yolo三种格式标签】

YOLO目标检测——工地安全帽手套数据集【含对应voc、coco和yolo三种格式标签】

m0_64879847的博客 856

【YOLO系列】YOLO V5模型详解

YOLOv5根据参数量分为了YOLOv5n(Nano)、YOLOv5s(Small)、YOLOv5m(Medium)、YOLOv5l(Large)和 YOLOv5x(Extra Large)五种类型,其参数量依次上升,当然了其效果也是越来越好。从2020年6月发布至2022年11月已经更新了7个大版本,在v7版本中还添加了语义分割的功能。

江湖小Jay的博客 4585

Yolov5训练权重+官方yolov5n和yolov5s+可见光单个人体识别权重+.pt文件

1.包含github上的5n和5s两个快速训练权重以及经过训练后的单个人体目标的最佳识别结果 2.训练环境:win10 3.迭代次数:300+ 4.精确率和召回率均收敛

智慧工地项目-基于YOLOv5和Pyqt5的安全帽佩戴检测系统及危险区域入侵检测告警系统源码(含GUI界面+数据集+模型+部署说明).zip

智慧工地项目 1、智慧工地项目-基于YOLOv5和Pyqt5的安全帽佩戴检测系统及危险区域入侵检测告警系统源码(含GUI界面+数据集+模型+部署说明).zip 2、该项目是使用 YOLOv5 算法来实现在智能工地安全领域中头盔目标检测的应用。 运用yolov5网络进行工人安全帽检测以及危险区域入侵检测,报警。 3、使用的pytorch深度学习框架,python语言编写。 源码中带有pyqt5写的GUI界面,界面按钮名称可以自定义。 4、可自定义绘制危险区域,当有入侵进行告警 资源中含有项目详细操作文档介绍,建议根据项目说明来一步步操作。 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用!有问题请及时沟通交流。 2、适用人群:计算机相关专业(如计科、信息安全、数据科学与大数据技术、人工智能、通信、物联网、自动化、电子信息等)在校学生、专业老师或者企业员工下载使用。 3、用途:项目具有较高的学习借鉴价值,不仅适用于小白学习入门进阶。也可作为毕设项目、课程设计、大作业、初期项目立项演示等。 4、如果基础还行,或热爱钻研,亦可在此项目代码基础上进行修

助力安全生产,基于轻量级yolov5n模型开发构建工地穿戴安全帽、反光衣检测识别系统

助力安全生产,基于轻量级yolov5n模型开发构建工地穿戴安全帽、反光衣检测识别系统

Together_CZ的博客 1002

什么是以太网链路聚合

以太网链路聚合技术通过将多个物理端口捆绑成逻辑端口,可显著提升网络性能。该技术能增加总带宽(各链路带宽之和)、提高可靠性(故障秒级切换)并实现智能负载分担。主要分为手工模式和基于LACP协议的动态模式,后者能检测链路故障更可靠。配置时需确保接口参数一致、模式匹配,适用于核心交换、服务器接入等场景。华为设备通过创建Eth-Trunk接口、指定LACP模式并添加成员接口即可完成部署。这项成熟技术能以低成本解决带宽瓶颈和可靠性问题,是构建高速稳定网络的关键方案。

lai_2020的博客 673

YOLOv5模型版本详解:n/s/m/l的区别与选型指南

YOLOv5是Ultralytics团队推出的高效目标检测模型,包含**Nano (n)、Small (s)、Medium (m)、Large (l)**四个主要版本。各版本通过调整网络深度与宽度,平衡检测精度与推理速度,满足不同硬件平台的部署需求。注:测试环境为NVIDIA T4 GPU,输入分辨率640x640,FP16精度 3.1.1 通道数变化 Focus层:检测头通道:计算影响:精度与速度的平衡关系图(图表/曲线图示) 5.2 模型优化技巧 5.2.1 量化压缩 5.2.2 网络剪枝 六、版本

2503_90221393的博客 1万+

5、OpenClaw(龙虾助手)飞书机器人完整对接指南(2026最新版)

OpenClaw v2026.2.2+ 版本,防火墙内也能正常工作,是目前最稳定、最简单的企业内部AI助手部署方案。

欢迎光临~知1而N的博客 457

SAP 小结

关于SAP 开发的实习就要告一段落了,从刚开始接触,到现在已经6个月了,想要很简要的把自己对SAP的理解写出来,便于以后查阅(不定期更新)。 1. 什么是SAP? 广义的SAP,可以指代SAP公司以及SAP的各种产品,它的意义要在特定语境下才能确定。一般我们所说的SAP特指SAP ERP。 SAP ERP(enterprise resource planning)是一个企业信息系统。通过这个系

Remy的博客 1951

基于yolov5n的轻量级MSTAR遥感影像目标检测系统设计开发实战

yolov3/yolov4/yolov5/yolov6/yolov7/lite/fastdet/efficientdet各系列模型开发、项目交付、组合改造创新之—MSTAR遥感目标对象检测系统设计开发

Together_CZ的博客 3108

AVL Cruise 2020.1 安装教程

AVL Cruise 2020.1 安装教程

chengkai730的博客 9479

树莓派4B部署YOLOv5n[YOLOv5 PyQt5 ONNX]

简单Demo:利用pyqt设计yolov5目标检测GUI界面,使用ONNX框架部署在树莓派4B上运行。

weixin_41648964的博客 7690

模型实战(31)之 yolo26 实现对手部关键点数据集 的训练与关键点检测

模型实战(31)之 yolo26 实现对手部关键点数据集 的训练与关键点检测

yohnyang的博客 208

【tessy】软件环境配置:Keil C51 Keil uVision UVSC (Default)

本文详细说明了tessy软件如何配置【Keil C51 Keil uVision UVSC (Default)】环境,具体操作步骤和注意事项

qq_37282365的博客 600

YOLOv5结构讲解

YOLOv5整体结构图

weixin_42035080的博客 6251

Linux系列:SecurtCRT中的密码如何找回

【代码】Linux系列:SecurtCRT中的密码如何找回。

NIO4444 1084

使用YOLOv5n完成人体目标检测任务

使用YOLOv5n完成人体目标检测任务的流程,包括环境安装、数据集处理、训练和检测流程、数据可视化

m0_63783611的博客 1365

秋招突击——笔试整理——8/25——拼多多笔试整理

继续加油! 转变思维,有简单到复杂,由直观到抽象,这种贪心模拟的题目一直是这样的!

Blackoutdragon的博客 2400

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

基于轻量级YOLOv5n/s/m三款模型开发构建基于无人机视角的高空红外目标检测识别分析系统,对比测试分析性能

基于轻量级YOLOv5n/s/m三款模型开发构建基于无人机视角的高空红外目标检测识别分析系统,对比测试分析性能 欢迎关注微信公众号 PythonAI之路

Together_CZ的博客 1953

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

基于轻量级yolov5n开发构建奶牛实例分割检测识别系统

基于轻量级yolov5n开发构建奶牛实例分割检测识别系统

Together_CZ的博客 865

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

python基于YOLOv5全系列模型【n/s/m/l/x】开发构建不同参数量级电力设备螺母缺销小目标检测识别系统

python基于YOLOv5全系列模型【n/s/m/l/x】开发构建不同参数量级电力设备螺母缺销小目标检测识别系统

Together_CZ的博客 1520

YOLOv5网络详解

前言 YOLOv5项目的作者是Glenn Jocher并不是原Darknet项目的作者Joseph Redmon,并且这个项目至今都没有发表过正式的论文。 官方源码仓库:https://github.com/ultralytics/yolov5

STATEABC的博客 2万+

一个更快的YOLOv5问世,附送全面中文解析教程

作为计算机视觉领域的基础性技术,目标检测在业界具有广泛应用,而YOLO系列因其综合性能较好,成为广受欢迎的首选框架。这次,为了让用户深入了解 OneFlow 训练目标检测模型的可行性以及性能的优越性,我们将 Ultralytics 版 YOLOv5(https://github.com/ultralytics/yolov5)通过 import oneflow as torch 的方式迁移为 One...

OneFlow深度学习框架 8171

【YOLO性能对比试验】YOLOv9c/v8n/v6n/v5n的训练结果对比及结论参考

【YOLO性能对比试验】YOLOv9c/v8n/v6n/v5n的训练结果对比及结论参考

阿旭的博客 1万+
上一篇: 【发疯毕设日志】基于大疆tello的计算机视觉毕设 day2
下一篇: 【发疯毕设日志day4】基于大疆tello,实现工地安全检测
叫我Python小朋友
博客等级 码龄6年 128粉丝 24原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值