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

相关推荐
Dxy12393102165 分钟前
PyTorch的CyclicLR详细介绍:给模型训练装上“涡轮增压”
人工智能·pytorch·python
那小子、真烦11 分钟前
OpenClaw Skill 编写规范 与示例
python
nananaij21 分钟前
【LeetCode-02 最小偶倍数 python解法】
python·算法·leetcode
英英_30 分钟前
Selenium 常用浏览器操作全解析
python·selenium·测试工具
咕泡科技1 小时前
从0到1系统学习大模型:一份接地气的入门指南
人工智能·python·学习
KerwinChou_CN1 小时前
大模型 RAG 中 RRF(Reciprocal Rank Fusion倒数排序融合)是什么
人工智能·后端·python
无巧不成书02181 小时前
Java数值字面量速查表
java·开发语言·python·开发者·字面量
小鸡吃米…1 小时前
测试线程应用程序
开发语言·python
python开发笔记1 小时前
python(79) 底层代码追踪工具
开发语言·python