YOLO10 用分割数据集训练

1、 下载Funiture数据集

http://kaggle.com/datasets/nicolaasregnier/furniture

并生成数据配置文件 data.yaml

复制代码
import yaml
import os
dataDir ="你的工程路径/Furniture/sam_preds_training_set"
os.path.join(dataDir, 'train')
num_classes = 2
classes = ['Chair', 'Sofa']
file_dict = {
'train': os.path.join(dataDir, 'train'),
'val': os.path.join(dataDir, 'val'),
'test': os.path.join(dataDir, 'test'),
'nc': num_classes,
'names': classes
}
with open(os.path.join("./", 'data.yaml'), 'w+') as f:
    yaml.dump(file_dict, f)

二、训练

复制代码
from ultralytics import YOLO

# Load YOLOv10n model from scratch
model = YOLO("yolov10n.yaml").load("yolov10n.pt")



model.train(data="data.yaml", epochs=100, imgsz=640,freeze=22)

三、测试

复制代码
model = YOLO("生成的模型路径/ultralytics/runs/detect/train16/weights/best.pt") # 100epchs


res = model.predict("你的数据集路径/Furniture/sam_preds_training_set/test/images/Sofa--365-_jpg.rf.8ec5e13d87ce8491a9e8b4c999ea7330.jpg")
res[0].save("result-chair.jpg")

注意要训练100epochs 效果好

注意的是这个分割数据集来训练检测数据集,都可以,奇怪了

相关推荐
guslegend5 分钟前
AI 编程范式转换与 Memory 工程:从无状态模型到 AGENTS.md 声明式配置
人工智能·大模型·agent·ai编程·opencode
jeffsonfu8 分钟前
序列到序列(Seq2Seq)模型:机器翻译背后的核心技术
人工智能·自然语言处理·机器翻译
Yolanda_202214 分钟前
21.神经网络-线性层及其他层介绍
人工智能·深度学习·神经网络
鱼宵14 分钟前
Spring AI 初体验:配好 yml 就能聊,ChatClient 四步链式调用
人工智能·spring·microsoft·大模型·springai·chatclient
答案是你18 分钟前
YOLOE 开放词汇检测 + ONNX / TensorRT 推理,开源了!
python·深度学习·yolo·目标检测·计算机视觉·视觉检测
朝朝辞暮i28 分钟前
VLA 系统学习第 7 课:loss.backward() 到底做了什么?——从计算图到反向传播
人工智能·python·深度学习·神经网络·vla
serdes2130 分钟前
56G PAM4 SerDes RX MMCDR Mueller–Müller 误差检测与数据对齐设计
人工智能
倔强的石头10635 分钟前
DeepSeek系列_国产大模型的技术创新解析
人工智能·大模型
企业数字化笔记36 分钟前
AI工具的文件和参数怎么设计?上传校验、配置版本与可复现任务
前端·人工智能