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

相关推荐
sali-tec1 分钟前
C# 基于halcon的视觉工具VisionTool Halcon发布
人工智能·深度学习·算法·计算机视觉·分类
写代码的【黑咖啡】2 分钟前
Python中的文件操作详解
java·前端·python
q_30238195563 分钟前
秒级筛查+94.7%精准!华为Atlas 200 DK边缘设备解锁糖尿病视网膜病变检测新范式
人工智能·python·深度学习·智能体
AndrewHZ10 分钟前
【python与生活】从手机定位到车辆导航:GPS定位算法原理与Python实现
python·智能手机·生活·gps·定位算法·北斗卫星·车辆导航
Edward.W27 分钟前
PyQt6 打造苹果风格 ADB 图形化工具:adbUI 深度测评与实战指南
python·adb·pyqt
纪伊路上盛名在33 分钟前
vscode的colab扩展目前的一些问题
ide·vscode·python·编辑器·colab·前后端
宁大小白36 分钟前
pythonstudy Day41
python·机器学习
MarkHD37 分钟前
智能体在车联网中的应用:第14天 卷积神经网络(CNN)专精:从卷积原理到LeNet-5实战车辆图像分类
人工智能·分类·cnn
盼哥PyAI实验室40 分钟前
Python 爬虫核心基础:请求与响应机制全解析(从 GET 请求到 JSON 分页实战)
爬虫·python·json
Tipriest_40 分钟前
Python 常用特殊变量与关键字详解
linux·python·关键字·特殊变量