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

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

相关推荐
Joy T4 分钟前
Spring Security 从 Acegi 到 AI Agent——JWT、角色鉴权与异步任务安全实战
人工智能·安全·spring·spring security·json web token·securitycontext·多次鉴权
AIHR数智引擎40 分钟前
拆掉“关键人依赖”:黄仁勋复职全员会上的四道组织切口
人工智能·经验分享·职场和发展·ai-native·英伟达·aihr
Flynn Liang41 分钟前
全栈实战:从零搭建一套可落地的生产级 AI 智能体系统(Redis 版)
人工智能·redis·ai agent
小九九的爸爸42 分钟前
为了收第一笔钱,我终于打通OPC支付链路
人工智能·程序员·全栈
kyriewen1 小时前
我写的 12 个 AI Skill,三个月后 8 个在吃空饷
javascript·人工智能·程序员
陆枫Larry1 小时前
MCP 实践(二):让自己开发的 MCP Server 调用真实 HTTP 接口
人工智能
阿里云大数据AI技术1 小时前
从空间圈选到区域决策:EMR Serverless StarRocks(Stella)的 GIS 架构与空间索引实践
人工智能
掘金酱2 小时前
X-Lab 年度大会线上同步活动 | 带上你的 AI 作品,来 X-Lab 年度大会聊聊 AI 新生意!
人工智能
阿里云大数据AI技术2 小时前
Hologres 长记忆服务发布知识库:好记性,也要懂业务
人工智能
AllData公司负责人2 小时前
实战二:AllData大模型与AI数据底座-数据传输平台-DBSyncer,搭建 Http 接口同步至 Doris,API 业务数据自动拉取入数仓
大数据·数据库·数据仓库·人工智能·算法·http·doris