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: person
  1: bicycle
  2: car
  3: motorcycle
  4: airplane
  5: bus
  6: train
  7: truck
  8: boat
  9: traffic light
  10: fire hydrant
  11: stop sign
  12: parking meter
  13: bench
  14: bird
  15: cat
  16: dog
  17: horse
  18: sheep
  19: cow
  20: elephant
  21: bear
  22: zebra
  23: giraffe
  24: backpack
  25: umbrella
  26: handbag
  27: tie
  28: suitcase
  29: frisbee
  30: skis
  31: snowboard
  32: sports ball
  33: kite
  34: baseball bat
  35: baseball glove
  36: skateboard
  37: surfboard
  38: tennis racket
  39: bottle
  40: wine glass
  41: cup
  42: fork
  43: knife
  44: spoon
  45: bowl
  46: banana
  47: apple
  48: sandwich
  49: orange
  50: broccoli
  51: carrot
  52: hot dog
  53: pizza
  54: donut
  55: cake
  56: chair
  57: couch
  58: potted plant
  59: bed
  60: dining table
  61: toilet
  62: tv
  63: laptop
  64: mouse
  65: remote
  66: keyboard
  67: cell phone
  68: microwave
  69: oven
  70: toaster
  71: sink
  72: refrigerator
  73: book
  74: clock
  75: vase
  76: scissors
  77: teddy bear
  78: hair drier
  79: toothbrush

# Download script/URL (optional)
download: |
  from ultralytics.utils.downloads import download
  from pathlib import Path

  # Download labels
  segments = True  # segment or box labels
  dir = Path(yaml['path'])  # dataset root dir
  url = 'https://github.com/ultralytics/yolov5/releases/download/v1.0/'
  urls = [url + ('coco2017labels-segments.zip' if segments else 'coco2017labels.zip')]  # labels
  download(urls, dir=dir.parent)
  # Download data
  urls = ['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

相关推荐

  1. yolov8训练流程

    2024-04-07 02:14:02       89 阅读
  2. yolov8 训练voc数据集

    2024-04-07 02:14:02       48 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-07 02:14:02       75 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-07 02:14:02       80 阅读
  3. 在Django里面运行非项目文件

    2024-04-07 02:14:02       64 阅读
  4. Python语言-面向对象

    2024-04-07 02:14:02       75 阅读

热门阅读

  1. 【物联网】Qinghub opc-da 连接协议

    2024-04-07 02:14:02       44 阅读
  2. 蓝桥杯算法基础(38)c++ STL

    2024-04-07 02:14:02       29 阅读
  3. UI python 中的basePage 类元素的最全的相关公共方法

    2024-04-07 02:14:02       91 阅读
  4. 数据库第四次作业

    2024-04-07 02:14:02       40 阅读
  5. linux命令大全(涵盖所有命令)

    2024-04-07 02:14:02       40 阅读
  6. ffplay用硬件进行编解码的命令的探索:

    2024-04-07 02:14:02       33 阅读
  7. 通过 ffmpeg命令行 调节视频播放速度

    2024-04-07 02:14:02       139 阅读
  8. Linux高级IO——多路转接之select

    2024-04-07 02:14:02       135 阅读