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

相关推荐
Java&Develop35 分钟前
DeltaFStation 宝塔 Linux 部署教程
python
小柯南敲键盘40 分钟前
跨境电商图片翻译工具推荐:批量AI翻译+视频字幕+智能抠图
人工智能·python·音视频
北斗落凡尘1 小时前
LangGraph 入门实战(8)--绑定工具
python·langchain
ningmengjing_1 小时前
MCP 通讯方式与实现指南
python·agent·mcp
淼澄研学1 小时前
Kimi API黑产倒卖技术解析与Python合规接入指南
开发语言·网络·python
何以解忧,唯有..1 小时前
Python 元组(tuple)详解:使用、遍历与排序
开发语言·python
KANGBboy1 小时前
Python eval安全隐患
开发语言·python
evans在进步2 小时前
LeetCode 394:字符串解码——Java 单栈模拟与嵌套解析详解
java·python·leetcode
淼澄研学2 小时前
Python结合大模型挖掘搜题长尾关键词实操指南
开发语言·python
中科高级技工学校4 小时前
乌鲁木齐美术艺考技校实践分享
人工智能·python