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

相关推荐
zero15972 分钟前
Python 8天极速入门笔记(大模型工程师专用):第七篇-文件操作 + 异常处理,大模型实战落地关键
python·ai编程·大模型编程语言
T0uken7 分钟前
【Python】uvpacker:跨平台打包 Windows 应用
开发语言·python
Li emily14 分钟前
解决了用美股历史数据api分析价格波动的困扰
数据库·人工智能·python
Xpower 1719 分钟前
PHM念叨叨系列--工业场景大模型幻觉治理
人工智能·python·语言模型
请数据别和我作队21 分钟前
基于 DeepSeek API 的 ASR 文本纠错脚本实战:Python 多线程批量处理 JSONL 语音转写数据
开发语言·经验分享·python·自然语言处理·nlp
Circ.1 小时前
文本相似性对比python代码
开发语言·python·相似度
Ahtacca1 小时前
基于决策树算法的动物分类实验:Mac环境复现指南
python·算法·决策树·机器学习·ai·分类
李元豪1 小时前
3分分类计算差值
人工智能·分类·数据挖掘
萌>__<新1 小时前
AI聊天助手-测试报告
人工智能·python
sg_knight1 小时前
设计模式实战:观察者模式(Observer)
python·观察者模式·设计模式