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

相关推荐
批量小王子3 分钟前
批量统一图像色彩
python
自在如风。35 分钟前
Java 设计模式:装饰者模式详解
java·python·设计模式
大模型真好玩38 分钟前
不写一行代码! VsCode+Cline+高德地图MCP Server 帮你搞定和女友的出行规划(附原理解析)
人工智能·python·mcp
再玩一会儿看代码43 分钟前
pip 与 conda 的全面比较:Python 包管理的深度解析
经验分享·笔记·python·conda·课程设计·pip
Clocky71 小时前
opencv-python基础
开发语言·python
满怀10151 小时前
【Python Requests 库详解】
开发语言·python
Mr_Chenph2 小时前
YOLO 8 入坑(持续更新)
yolo·yolo8
小白教程2 小时前
Python爬取视频的架构方案,Python视频爬取入门教程
python·架构·音视频·python爬虫·python视频爬虫·python爬取视频教程
AI技术控2 小时前
基于YOLOv8的机场跑道异物检测识别系统:提升航空安全的新一代解决方案(主页有源码)
yolo
仰望星空的小随3 小时前
django相关面试题
python·django·sqlite