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.训练过程

相关推荐
笑衬人心。5 分钟前
Ubuntu 22.04 修改默认 Python 版本为 Python3 笔记
笔记·python·ubuntu
蛋仔聊测试19 分钟前
Playwright 中 Page 对象的常用方法详解
python
前端付豪31 分钟前
17、自动化才是正义:用 Python 接管你的日常琐事
后端·python
jioulongzi32 分钟前
记录一次莫名奇妙的跨域502(badgateway)错误
开发语言·python
破无差1 小时前
python实现简单的地图绘制与标记20250705
python
喜欢吃豆1 小时前
目前最火的agent方向-A2A快速实战构建(二): AutoGen模型集成指南:从OpenAI到本地部署的全场景LLM解决方案
后端·python·深度学习·flask·大模型
好开心啊没烦恼2 小时前
Python 数据分析:DataFrame,生成,用字典创建 DataFrame ,键值对数量不一样怎么办?
开发语言·python·数据挖掘·数据分析
周树皮不皮2 小时前
20250704【翻转&二叉树】|Leetcodehot100之226【pass】&今天计划
python
魔芋红茶2 小时前
spring-initializer
python·学习·spring
喜欢吃豆3 小时前
快速手搓一个MCP服务指南(九): FastMCP 服务器组合技术:构建模块化AI应用的终极方案
服务器·人工智能·python·深度学习·大模型·github·fastmcp