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 效果好

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

相关推荐
北海道浪子几秒前
[免费送$1000]ClaudeCode、Codex等AI模型在开发中的使用
前端·人工智能·后端
福客AI12 分钟前
电商智能客服机器人:客服的服务革新之路
人工智能·机器人
CoderIsArt23 分钟前
CORDIC三角计算技术
人工智能·算法·机器学习
taxunjishu24 分钟前
Ethernet/ip 转 Modbus RTU 驱动,罗克韦尔 PLC 与华为逆变器打造光伏电站智能监控典范
人工智能·物联网·自动化·区块链
Alex艾力的IT数字空间26 分钟前
基于PyTorch和CuPy的GPU并行化遗传算法实现
数据结构·人工智能·pytorch·python·深度学习·算法·机器学习
却道天凉_好个秋40 分钟前
OpenCV(十三):通道的分离与合并
人工智能·opencv·计算机视觉
七宝大爷1 小时前
NVIDIA Blackwell Ultra GB300深度解析:AI芯片性能的新巅峰
人工智能·gpu·gb300
鲸鱼在dn1 小时前
大语言模型的后训练与“灾难性遗忘”问题——李宏毅2025大模型第六讲笔记
人工智能·笔记·语言模型
滑水滑成滑头1 小时前
**标题:发散创新:智能交通系统的深度探究与实现**摘要:本文将详细
java·人工智能·python
海云安2 小时前
海云安入选安全牛《企业级AI大模型落地实战技术应用指南(2025版)》优秀案例
人工智能·安全