基于yolov8的水面垃圾水面漂浮物检测系统python源码+onnx模型+评估指标曲线+精美GUI界面

【算法介绍】

基于YOLOv8的水面垃圾与漂浮物检测系统是一种高效、智能的监测解决方案。该系统利用YOLOv8这一前沿的深度学习模型,结合智能视频分析技术,对河道、湖泊等水面的垃圾漂浮物进行实时监测与识别。

YOLOv8作为YOLO系列的最新迭代,以其高准确度和实时检测能力著称。通过复杂的网络架构、优化的训练流程和强大的特征提取能力,YOLOv8能够在各种光照和水质条件下,准确识别包括生活垃圾、枯枝断木、水藻等在内的多种漂浮物。

该系统可以通过二次开发部署在河道或湖泊周边的监控摄像头,实现全天候、不间断的监测。一旦检测到水面有垃圾漂浮物,系统立即触发预警机制,并将抓拍到的图片或视频实时推送给后台管理人员,以便及时采取措施进行清理。

这种智能化的监测系统不仅大幅提升了河道治理的效率和效果,还显著降低了人工巡视的工作量。同时,它也促进了生态环境与水利环境的协调发展,为保障水质安全和水资源可持续利用提供了有力支持。

【效果展示】

【测试环境】

windows10

anaconda3+python3.8

torch==1.9.0+cu111

ultralytics==8.2.70

【模型可以检测出类别】

floating-trash

【训练信息】

|-----------------|-------|
| 参数 | 值 |
| 训练集图片数 | 1827 |
| 验证集图片数 | 128 |
| 训练map | 88.7% |
| 训练精度(Precision) | 82.9% |
| 训练召回率(Recall) | 83.8% |

【训练数据集(数据集经过优化可能与下载数据集存在差异)】

https://download.csdn.net/download/FL1623863129/89715522

【部分实现源码】

class Ui_MainWindow(QtWidgets.QMainWindow):
    signal = QtCore.pyqtSignal(str, str)
 
    def setupUi(self):
        self.setObjectName("MainWindow")
        self.resize(1280, 728)
        self.centralwidget = QtWidgets.QWidget(self)
        self.centralwidget.setObjectName("centralwidget")
 
        self.weights_dir = './weights'
 
        self.picture = QtWidgets.QLabel(self.centralwidget)
        self.picture.setGeometry(QtCore.QRect(260, 10, 1010, 630))
        self.picture.setStyleSheet("background:black")
        self.picture.setObjectName("picture")
        self.picture.setScaledContents(True)
        self.label_2 = QtWidgets.QLabel(self.centralwidget)
        self.label_2.setGeometry(QtCore.QRect(10, 10, 81, 21))
        self.label_2.setObjectName("label_2")
        self.cb_weights = QtWidgets.QComboBox(self.centralwidget)
        self.cb_weights.setGeometry(QtCore.QRect(10, 40, 241, 21))
        self.cb_weights.setObjectName("cb_weights")
        self.cb_weights.currentIndexChanged.connect(self.cb_weights_changed)
 
        self.label_3 = QtWidgets.QLabel(self.centralwidget)
        self.label_3.setGeometry(QtCore.QRect(10, 70, 72, 21))
        self.label_3.setObjectName("label_3")
        self.hs_conf = QtWidgets.QSlider(self.centralwidget)
        self.hs_conf.setGeometry(QtCore.QRect(10, 100, 181, 22))
        self.hs_conf.setProperty("value", 25)
        self.hs_conf.setOrientation(QtCore.Qt.Horizontal)
        self.hs_conf.setObjectName("hs_conf")
        self.hs_conf.valueChanged.connect(self.conf_change)
        self.dsb_conf = QtWidgets.QDoubleSpinBox(self.centralwidget)
        self.dsb_conf.setGeometry(QtCore.QRect(200, 100, 51, 22))
        self.dsb_conf.setMaximum(1.0)
        self.dsb_conf.setSingleStep(0.01)
        self.dsb_conf.setProperty("value", 0.25)
        self.dsb_conf.setObjectName("dsb_conf")
        self.dsb_conf.valueChanged.connect(self.dsb_conf_change)
        self.dsb_iou = QtWidgets.QDoubleSpinBox(self.centralwidget)
        self.dsb_iou.setGeometry(QtCore.QRect(200, 160, 51, 22))
        self.dsb_iou.setMaximum(1.0)
        self.dsb_iou.setSingleStep(0.01)
        self.dsb_iou.setProperty("value", 0.45)
        self.dsb_iou.setObjectName("dsb_iou")
        self.dsb_iou.valueChanged.connect(self.dsb_iou_change)
        self.hs_iou = QtWidgets.QSlider(self.centralwidget)
        self.hs_iou.setGeometry(QtCore.QRect(10, 160, 181, 22))
        self.hs_iou.setProperty("value", 45)
        self.hs_iou.setOrientation(QtCore.Qt.Horizontal)
        self.hs_iou.setObjectName("hs_iou")
        self.hs_iou.valueChanged.connect(self.iou_change)
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        self.label_4.setGeometry(QtCore.QRect(10, 130, 72, 21))
        self.label_4.setObjectName("label_4")
        self.label_5 = QtWidgets.QLabel(self.centralwidget)
        self.label_5.setGeometry(QtCore.QRect(10, 210, 72, 21))
        self.label_5.setObjectName("label_5")
        self.le_res = QtWidgets.QTextEdit(self.centralwidget)
        self.le_res.setGeometry(QtCore.QRect(10, 240, 241, 400))
        self.le_res.setObjectName("le_res")
        self.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(self)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 1110, 30))
        self.menubar.setObjectName("menubar")
        self.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(self)
        self.statusbar.setObjectName("statusbar")
        self.setStatusBar(self.statusbar)
        self.toolBar = QtWidgets.QToolBar(self)
        self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextBesideIcon)
        self.toolBar.setObjectName("toolBar")
        self.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
        self.actionopenpic = QtWidgets.QAction(self)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/images/1.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionopenpic.setIcon(icon)
        self.actionopenpic.setObjectName("actionopenpic")
        self.actionopenpic.triggered.connect(self.open_image)
        self.action = QtWidgets.QAction(self)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/images/2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action.setIcon(icon1)
        self.action.setObjectName("action")
        self.action.triggered.connect(self.open_video)
        self.action_2 = QtWidgets.QAction(self)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/images/3.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.action_2.setIcon(icon2)
        self.action_2.setObjectName("action_2")
        self.action_2.triggered.connect(self.open_camera)
 
        self.actionexit = QtWidgets.QAction(self)
        icon3 = QtGui.QIcon()
        icon3.addPixmap(QtGui.QPixmap(":/images/4.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.actionexit.setIcon(icon3)
        self.actionexit.setObjectName("actionexit")
        self.actionexit.triggered.connect(self.exit)
 
        self.toolBar.addAction(self.actionopenpic)
        self.toolBar.addAction(self.action)
        self.toolBar.addAction(self.action_2)
        self.toolBar.addAction(self.actionexit)
 
        self.retranslateUi()
        QtCore.QMetaObject.connectSlotsByName(self)
        self.init_all()

【使用步骤】

使用步骤:

(1)首先根据官方框架https://github.com/ultralytics/ultralytics安装教程安装好yolov8环境,并安装好pyqt5

(2)切换到自己安装的yolov8环境后,并切换到源码目录,执行python main.py即可运行启动界面,进行相应的操作即可

【提供文件】

python源码

yolov8n.onnx模型(提供pytorch模型和所有训练日志)

训练的map,P,R曲线图(在weights\results.png)

测试图片(在test_img文件夹下面)

【源码下载地址】https://download.csdn.net/download/FL1623863129/89715583

相关推荐
FL16238631293 小时前
基于yolov5的混凝土缺陷检测系统python源码+onnx模型+评估指标曲线+精美GUI界面
人工智能·python·yolo
霍夫曼vx_helloworld73526 小时前
yolov5/8/9/10模型在VOC数据集上的应用【代码+数据集+python环境+GUI系统】
yolo
FL16238631296 小时前
[数据集][目标检测]车油口挡板开关闭合检测数据集VOC+YOLO格式138张2类别
人工智能·yolo·目标检测
FL16238631291 天前
智慧交通基于yolov8的行人车辆检测计数系统python源码+onnx模型+精美GUI界面
yolo
阿利同学1 天前
自动泊车系统中的YOLOv8 pose关键点车位线检测
yolo·自动泊车·关键点检测·车位检测·yolov8 pose·自定义模型训练·联系 qq1309399183
kay_5451 天前
YOLOv8改进 | 模块缝合 | C2f 融合SCConv提升检测性能【CVPR2023】
人工智能·python·深度学习·yolo·目标检测·面试·yolov8改进
FL16238631291 天前
[数据集][目标检测]葡萄成熟度检测数据集VOC+YOLO格式1123张3类别
人工智能·yolo·目标检测
FL16238631291 天前
[数据集][目标检测]无人机飞鸟检测数据集VOC+YOLO格式6647张2类别
深度学习·yolo·目标检测
FL16238631292 天前
[数据集][目标检测]高铁受电弓检测数据集VOC+YOLO格式1245张2类别
人工智能·yolo·目标检测
TAICHIFEI2 天前
1. YOLOv10: Real-Time End-to-End Object Detection
人工智能·笔记·yolo·目标检测·目标跟踪