python配合yolov11开发分类训练软件

  1. 上一篇文件写了用yolo分类模型开发分类软件,这边文章在上个分类软件的基础上加入训练功能
  2. 环境配置:pycharm,PySide6 6.6.1 ,PySide6-Addons 6.6.1,PySide6-Essentials 6.6.1,torch 2.3.1+cu121,torchaudio 2.3.1+cu121,torchvision 0.18.1+cu121,onnx 1.16.1,onnxruntime 1.17.3,opencv-contrib-python 4.10.0.82,opencv-python 4.10.0.82,opencv-python-headless 4.7.0.72
  3. 分类使用的数据集,halcon的pill分类demo的数据集

    4.软件界面

    5.核心代码
bash 复制代码
    def TrainThrExecut(self):
        _monitor_train.TrainSimple = True
        imagedealwith._image_deal_with.Model = YOLO(imagedealwith._image_deal_with.TrainPreprocessModelPath)
        results = imagedealwith._image_deal_with.Model.train(
            data=imagedealwith._image_deal_with.TrainDataFolderPath,
            project=imagedealwith._image_deal_with.TrainDataSaveFolderPath,
            epochs=200,
            batch=4,
            imgsz=224,
            amp=False)
        print(results)
        sucess = imagedealwith._image_deal_with.Model.export(format='onnx')
        _monitor_train.TrainSimple = False
        imagedealwith._image_deal_with.ImageDealWithStatus = ImageDealWithStatusEnu.Inference
        self.pbtn_training.setText("Train")
        pass

    def MonitorTrainLogCallback(self,message):
        if(len(message)>0):
            self.tedit_training_message.append(message)
        pass

    def MonitorTrainLossCallback(self,message):
        if (len(message) > 0):
            self.tedit_training_loss.setText(message)
            pass
        pass

    def MonitorTrainEpochCallback(self,message):
        if (len(message) > 0):
            self.ledit_training_epoch.setText('epoch:'+message)
        pass

6.训练过程

相关推荐
抓不住时间的沙21 分钟前
Butterfly主题 5.7 导航栏添加相册同时设置相册入口密码
css·python·node.js
风合星语34 分钟前
2026 机器人工程实例(五):让 Allegro Hand 在 MuJoCo 中完成接触抓取——抓取状态机、稳定抬升与受控释放
c++·python·机器人·仿真
隐擎fox1 小时前
解构无感人机验证底层机制:行为生物轨迹采样、环境评分模型与自动化对抗实战
自动化测试·python·网络协议·tcp/ip·网络爬虫
haidao0312 小时前
氙灯光源技术特性及其在光催化实验中的标准化应用研究
人工智能·python·能源
用户0332126663672 小时前
使用 Python 设置 Excel 行列自适应 【代码示例】
python·excel
Ticnix2 小时前
RAG 的坑不在检索,在"对齐":pgvector 实战手记
python·agent·全栈
kyrie_sakura2 小时前
python学习笔记14 -- FastAPI
笔记·python·学习·fastapi
春涧草茶2 小时前
慢就是快12-2三种访问权限|getter与setter|魔法方法
开发语言·python
夜雪一千3 小时前
如何使用Python做舆情分析
人工智能·python·数据分析
Ticnix3 小时前
MCP 工具拿不到 user_id?用 contextvars 做请求级用户隔离
python·agent·mcp