草莓成熟度检测数据集,基于深度学习YOLOV11草莓成熟度检测系统
草莓成熟度检测数据集基于深度学习YOLOV11草莓成熟度检测系统1275张yolovoccoco三种标注方式图像尺寸:640*640类别数量:3类训练集图像数量:1011; 验证集图像数量:254 测试集图像数量:10类别名称: 每一类图像数 每一类标注数Ripened 成熟的: 840,1958Unripened 不成熟的: 925,3088Semi-Ripened 半成熟的: 681,1402image num: 1275模型代码模型训练使用yolov11n训练50个epoch训练结果map如描述图所示。qt界面运行界面采用pyqt编写本项目已经训练好模型配置好环境后可直接使用运行效果见描述图像草莓成熟度检测数据集数据集总览表项目参数数据集名称草莓成熟度检测数据集图像总数量1275张图像尺寸640×640标注格式YOLO、VOC、COCO类别总数3类训练集1011张验证集254张测试集10张类别统计中英对照英文类别中文名称含该类图像数标注实例数Ripened成熟草莓8401958Unripened未成熟草莓9253088Semi‑Ripened半成熟草莓6811402数据集yaml配置文件 strawberry.yamltrain:./train/imagesval:./val/imagestest:./test/imagesnc:3names:0:Ripened1:Unripened2:Semi-Ripened关键词草莓成熟度检测、果蔬目标检测、农业视觉检测、大棚草莓识别、YOLOv11、果蔬分级、智慧农业、农作物成熟度判别标签#智慧农业#草莓成熟度检测#YOLOv11#果蔬目标检测应用场景温室大棚草莓自动采摘机器人视觉识别区分成熟、半成熟、未成熟果实草莓产量统计、成熟度分级辅助农业生产管理科研实验农业目标检测算法训练与对比实验嵌入式端部署田间移动端草莓检测系统二次开发训练代码 train_strawberry.pyfromultralyticsimportYOLOif__name____main__:modelYOLO(yolo11n.pt)resultsmodel.train(datastrawberry.yaml,epochs50,imgsz640,batch8,device0,workers2,mosaic0.7,patience12)#模型评估model.val()#单张图片推理model.predict(sourcetest.jpg,saveTrue,conf0.25)简易推理代码 infer_strawberry.pyfromultralyticsimportYOLO modelYOLO(best.pt)defdetect_strawberry(img_path):resmodel.predict(img_path,conf0.25,saveFalse)forrinres:boxesr.boxesforboxinboxes:x1,y1,x2,y2map(int,box.xyxy[0])conffloat(box.conf[0])cls_idint(box.cls[0])cls_namemodel.names[cls_id]print(f类别:{cls_name},置信度:{conf:.2f},坐标:[{x1},{y1},{x2},{y2}])res[0].save(strawberry_result.jpg)if__name____main__:detect_strawberry(1.jpg)PyQt5简易GUI界面完整代码 main_ui.pyimportsysimportcv2fromPyQt5.QtWidgetsimport(QApplication,QMainWindow,QWidget,QVBoxLayout,QPushButton,QLineEdit,QTableWidget,QTableWidgetItem,QFileDialog,QLabel,QComboBox)fromPyQt5.QtGuiimportQImage,QPixmapfromultralyticsimportYOLOclassStrawberryDetectWindow(QMainWindow):def__init__(self):super().__init__()self.setWindowTitle(基于YOLOv11的草莓成熟度检测系统)self.resize(1200,800)self.modelYOLO(best.pt)self.img_pathNoneself.init_ui()definit_ui(self):centralQWidget()self.setCentralWidget(central)layoutQVBoxLayout(central)self.label_imgQLabel(图片显示区域)layout.addWidget(self.label_img)self.line_fileQLineEdit()layout.addWidget(self.line_file)self.btn_openQPushButton(导入图片)self.btn_open.clicked.connect(self.open_image)layout.addWidget(self.btn_open)self.btn_detectQPushButton(执行检测)self.btn_detect.clicked.connect(self.run_detect)layout.addWidget(self.btn_detect)self.tableQTableWidget()self.table.setColumnCount(5)self.table.setHorizontalHeaderLabels([序号,文件路径,类别,置信度,坐标])layout.addWidget(self.table)defopen_image(self):file,_QFileDialog.getOpenFileName(filter图片(*.jpg *.png *.jpeg))iffile:self.img_pathfileself.line_file.setText(file)pixQPixmap(file)self.label_img.setPixmap(pix.scaled(self.label_img.size()))defrun_detect(self):ifnotself.img_path:returnresself.model.predict(self.img_path,conf0.25)self.table.setRowCount(0)idx0forrinres:forboxinr.boxes:idx1x1,y1,x2,y2map(int,box.xyxy[0])confround(float(box.conf[0]),2)cls_nameself.model.names[int(box.cls[0])]rowself.table.rowCount()self.table.insertRow(row)self.table.setItem(row,0,QTableWidgetItem(str(idx)))self.table.setItem(row,1,QTableWidgetItem(self.img_path))self.table.setItem(row,2,QTableWidgetItem(cls_name))self.table.setItem(row,3,QTableWidgetItem(str(conf)))self.table.setItem(row,4,QTableWidgetItem(f[{x1},{y1},{x2},{y2}]))#保存检测绘图结果r.save(ui_result.jpg)if__name____main__:appQApplication(sys.argv)winStrawberryDetectWindow()win.show()sys.exit(app.exec_())环境依赖ultralytics8.3.0 torch2.0 opencv-python pyqt5将训练输出的best.pt权重放在代码同级目录直接运行main_ui.py即可启动可视化检测界面。