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

yolov8训练流程

训练代码

from ultralytics import YOLO# Load a model
model = YOLO('yolov8n.yaml')  # build a new model from YAML
model = YOLO('yolov8n.pt')  # load a pretrained model (recommended for training)
model = YOLO('yolov8n.yaml').load('yolov8n.pt')  # build from YAML and transfer weights# Train the model
results = model.train(data='coco128.yaml', epochs=100, imgsz=640)
print(results)

数据集路径

ultralytics/cfg/datasets/coco.yaml
# Ultralytics YOLO 🚀, AGPL-3.0 license
# COCO 2017 dataset https://cocodataset.org by Microsoft
# Documentation: https://docs.ultralytics.com/datasets/detect/coco/
# Example usage: yolo train data=coco.yaml
# parent
# ├── ultralytics
# └── datasets
#     └── coco  ← downloads here (20.1 GB)# 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: ../datasets/coco128 # dataset root dir
train: images/train2017 # train images (relative to 'path') 128 images
val: images/train2017 # val images (relative to 'path') 128 images
test: # test images (optional)https://competitions.codalab.org/competitions/20794# Classes
names:0: person1: bicycle2: car3: motorcycle4: airplane5: bus6: train7: truck8: boat9: traffic light10: fire hydrant11: stop sign12: parking meter13: bench14: bird15: cat16: dog17: horse18: sheep19: cow20: elephant21: bear22: zebra23: giraffe24: backpack25: umbrella26: handbag27: tie28: suitcase29: frisbee30: skis31: snowboard32: sports ball33: kite34: baseball bat35: baseball glove36: skateboard37: surfboard38: tennis racket39: bottle40: wine glass41: cup42: fork43: knife44: spoon45: bowl46: banana47: apple48: sandwich49: orange50: broccoli51: carrot52: hot dog53: pizza54: donut55: cake56: chair57: couch58: potted plant59: bed60: dining table61: toilet62: tv63: laptop64: mouse65: remote66: keyboard67: cell phone68: microwave69: oven70: toaster71: sink72: refrigerator73: book74: clock75: vase76: scissors77: teddy bear78: hair drier79: toothbrush# Download script/URL (optional)
download: |from ultralytics.utils.downloads import downloadfrom pathlib import Path# Download labelssegments = True  # segment or box labelsdir = Path(yaml['path'])  # dataset root dirurl = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')]  # labelsdownload(urls, dir=dir.parent)# Download dataurls = ['http://images.cocodataset.org/zips/train2017.zip',  # 19G, 118k images'http://images.cocodataset.org/zips/val2017.zip',  # 1G, 5k images'http://images.cocodataset.org/zips/test2017.zip']  # 7G, 41k images (optional)download(urls, dir=dir / 'images', threads=3)

数据集格式
安装labelme

conda create --name=labelme python=3
conda activate labelme
pip install labelme

启动

labelme  # just open gui
http://www.lryc.cn/news/331401.html

相关文章:

  • Java基础学习: Forest - 极简 HTTP 调用 API 框架
  • Pandas Dataframe合并连接Join和merge 参数讲解
  • ABC318 F - Octopus
  • Docker实战教程 第3章 Dockerfile
  • JSON在量化交易系统中的应用
  • x-cmd-pkg | broot 是基于 Rust 开发的一个终端文件管理器
  • 设置asp.net core WebApi函数请求参数可空的两种方式
  • Vue.js组件精讲 开篇:Vue.js的精髓——组件
  • R语言中的常用数据结构
  • 基于Python的微博旅游情感分析、微博舆论可视化系统
  • 机器学习的模型校准
  • 0.17元的4位数码管驱动芯片AiP650,支持键盘,还是无锡国家集成电路设计中心某公司的
  • 【C++】编程规范之内存规则
  • 并发编程之线程池的应用以及一些小细节的详细解析
  • 基于JSP的农产品供销服务系统
  • redis之主从复制、哨兵模式
  • 【随笔】Git 基础篇 -- 分支与合并 git rebase(十)
  • 图像识别技术在体育领域的应用
  • 【项目新功能开发篇】开发编码
  • 软件设计原则:开闭原则
  • Python如何下载视频
  • 使用虚拟引擎为AR体验提供动力
  • Kafka入门到实战-第五弹
  • Ideal Holidays
  • Raven:一款功能强大的CICD安全分析工具
  • 【苹果MAC】苹果电脑 LOGI罗技鼠标设置左右切换全屏页面快捷键
  • IDE/VS2015和VS2017帮助文档MSDN安装和使用
  • 开启 Keep-Alive 可能会导致http 请求偶发失败
  • 【leetcode面试经典150题】4.删除有序数组中的重复项 II(C++)
  • 【LeetCode热题100】【普通数组】合并区间