当前位置: 首页 > news >正文

yolov8 训练voc数据集

yolov8训练

from ultralytics import YOLO# 加载模型
# model = YOLO('yolov8n.yaml')  # 从YAML构建新模型
# model = YOLO('yolov8n.pt')    # 加载预训练模型(推荐用于训练)
model = YOLO('yolov8n.yaml').load('yolov8n.pt')  # 从YAML构建并转移权重# 训练模型
results = model.train(data='VOC.yaml', epochs=100, imgsz=640)

VOC.yaml

# Train/val/test sets as 1) dir: path/to/imgs, 2) file: path/to/imgs.txt, or 3) list: [path/to/imgs1, path/to/imgs2, ..]
path: D:/Projects/yolo-v7/voc
train: # train images (relative to 'path')  16551 images- images/train2007- images/val2007
val: # val images (relative to 'path')  4952 images- images/test2007
test: # test images (optional)- images/test2007# Classes
names:0: aeroplane1: bicycle2: bird3: boat4: bottle5: bus6: car7: cat8: chair9: cow10: diningtable11: dog12: horse13: motorbike14: person15: pottedplant16: sheep17: sofa18: train19: tvmonitor

yolov8n.yaml

# Ultralytics YOLO 🚀, AGPL-3.0 license
# YOLOv8 object detection model with P3-P5 outputs. For Usage examples see https://docs.ultralytics.com/tasks/detect# Parameters
nc: 80  # number of classes
scales: # model compound scaling constants, i.e. 'model=yolov8n.yaml' will call yolov8.yaml with scale 'n'# [depth, width, max_channels]n: [0.33, 0.25, 1024]  # YOLOv8n summary: 225 layers,  3157200 parameters,  3157184 gradients,   8.9 GFLOPs# s: [0.33, 0.50, 1024]  # YOLOv8s summary: 225 layers, 11166560 parameters, 11166544 gradients,  28.8 GFLOPs# m: [0.67, 0.75, 768]   # YOLOv8m summary: 295 layers, 25902640 parameters, 25902624 gradients,  79.3 GFLOPs# l: [1.00, 1.00, 512]   # YOLOv8l summary: 365 layers, 43691520 parameters, 43691504 gradients, 165.7 GFLOPs# x: [1.00, 1.25, 512]   # YOLOv8x summary: 365 layers, 68229648 parameters, 68229632 gradients, 258.5 GFLOPs# YOLOv8.0n backbone
backbone:# [from, repeats, module, args]- [-1, 1, Conv, [64, 3, 2]]  # 0-P1/2- [-1, 1, Conv, [128, 3, 2]]  # 1-P2/4- [-1, 3, C2f, [128, True]]- [-1, 1, Conv, [256, 3, 2]]  # 3-P3/8- [-1, 6, C2f, [256, True]]- [-1, 1, Conv, [512, 3, 2]]  # 5-P4/16- [-1, 6, C2f, [512, True]]- [-1, 1, Conv, [1024, 3, 2]]  # 7-P5/32- [-1, 3, C2f, [1024, True]]- [-1, 1, SPPF, [1024, 5]]  # 9# YOLOv8.0n head
head:- [-1, 1, nn.Upsample, [None, 2, 'nearest']]- [[-1, 6], 1, Concat, [1]]  # cat backbone P4- [-1, 3, C2f, [512]]  # 12- [-1, 1, nn.Upsample, [None, 2, 'nearest']]- [[-1, 4], 1, Concat, [1]]  # cat backbone P3- [-1, 3, C2f, [256]]  # 15 (P3/8-small)- [-1, 1, Conv, [256, 3, 2]]- [[-1, 12], 1, Concat, [1]]  # cat head P4- [-1, 3, C2f, [512]]  # 18 (P4/16-medium)- [-1, 1, Conv, [512, 3, 2]]- [[-1, 9], 1, Concat, [1]]  # cat head P5- [-1, 3, C2f, [1024]]  # 21 (P5/32-large)- [[15, 18, 21], 1, Detect, [nc]]  # Detect(P3, P4, P5)
http://www.lryc.cn/news/286654.html

相关文章:

  • Python笔记12-多线程、网络编程、正则表达式
  • X射线中关于高频高压发生器、高清晰平板探测器、大热容量X射线球管、远程遥控系统的解释
  • 【算法】最短路计数(搜索)复习
  • html火焰文字特效
  • Redis双写一致性
  • html+css+javascript实现贪吃蛇游戏
  • 【K8S】Kubernetes 中滚动发布由浅入深实战
  • MSP430仿真器使用常见问题
  • 芯驰E3340软件编译以及更新步骤
  • HCIA——18实验:NAT
  • 在VBA中使用SQL
  • vue项目中使用Element多个Form表单同时验证
  • 自然语言处理--概率最大中文分词
  • k8s-基础知识(Service,NodePort,CusterIP,NameSpace,资源限制)
  • 【腾讯云】您使用的腾讯云服务存在违规信息,请尽快处理
  • 深度学习 Day27——J6ResNeXt-50实战解析
  • 【力扣 50】Pow(x, n) C++题解(数学+递归+快速幂)
  • 速盾:服务器接入CDN后上传图片失败的解决方案
  • LabVIEW高级CAN通信系统
  • FastSpeech2——TTS论文阅读
  • 如何才能拥有比特币 - 01 ?
  • Unity | 渡鸦避难所-8 | URP 中利用 Shader 实现角色受击闪白动画
  • K8S--安装metrics-server,解决error: Metrics API not available问题
  • flume自定义拦截器
  • 安卓Spinner文字看不清
  • 深入浅出hdfs-hadoop基本介绍
  • 宝塔面板部署MySQL并结合内网穿透实现公网远程访问本地数据库
  • 数据结构<1>——树状数组
  • Servlet生命周期
  • npm i 报一堆版本问题