【算法介绍】

基于YOLOv8的106种鲜花识别花朵检测系统是一项融合了先进深度学习技术的创新应用。该系统利用YOLOv8算法,这一目前最先进的目标检测模型之一,实现了对106种不同花卉的快速、准确识别。

YOLOv8以其速度快、准确性高和鲁棒性强的特点,在花卉识别任务中展现出卓越性能。系统通过构建包含丰富多样花卉图像的数据集,并采用高效的网络结构和优化策略进行模型训练,从而确保了对各种花卉特征的高效提取和准确分类。

在实际应用中,该系统能够快速识别并标记出图像中的花卉种类,同时提供位置信息和置信度评分,为用户提供了直观、便捷的识别体验。无论是植物爱好者、园艺师还是科研人员,都可以通过该系统轻松实现花卉的自动识别与分类,提高工作效率和准确性。

此外,该系统还支持实时检测功能,能够在视频流或实时摄像头画面中实时识别花卉,进一步拓展了其应用场景和实用价值。未来,随着技术的不断发展和优化,基于YOLOv8的鲜花识别花朵检测系统将在更多领域发挥重要作用,为花卉保护、园林设计等领域提供有力支持。

【效果展示】

基于yolov8的106种鲜花识别花朵检测系统python源码+onnx模型+评估指标曲线+精美GUI界面_ico

基于yolov8的106种鲜花识别花朵检测系统python源码+onnx模型+评估指标曲线+精美GUI界面_ico_02

【测试环境】

windows10
anaconda3+python3.8
torch==1.9.0+cu111
ultralytics==8.2.70

【模型可以检测出类别】

[“Acaulis”,“Alstroemeria”,“Artichoke”,“Bommaji”,“Calla”,“Carnation”,“Chamnahree”,“Cosmos”,“Curcuma”,“Dalnancho”,“Dandelion”,“Dongja”,“Doraji”,“Echinacea”,“Englishdaisy”,“FranceGukhwa”,“Fritillaria”,“Geuknakjo”,“Geumeocho”,“Geumggyeguk”,“Geumjanhwa”,“Geummaehwa”,“GgangGgangyee”,“Gloriosa”,“Guemgangchorong”,“Gyeongyeopduran”,“Halmi”,“Jjille”,“Lentenrose”,“Marigold”,“Minariajaebi”,“Mugunghwa”,“Mulmangcho”,“Muskari”,“Nigella”,“NorangGgotchangpo”,“Norugwi”,“Poinsettia”,“Suseonhwa”,“Suyeompaeraengi”,“Sweetpea”,“Yongwang”,“alpine_sea_holly”,“anthurium”,“azalea”,“ball_moss”,“barbeton_daisy”,“bearded_iris”,“bee_balm”,“bishop_of_llandaff”,“black_eyed_susan”,“blackberry_lily”,“blanket_flower”,“bolero_deep_blue”,“bougainvillea”,“bromelia”,“californian_poppy”,“camellia”,“canna_lily”,“canterbury_bells”,“cape_flower”,“cautleya_spicata”,“clematis”,“columbine”,“common_dandelion”,“corn_poppy”,“cyclamen”,“desert-rose”,“foxglove”,“frangipani”,“garden_phlox”,“gaura”,“gazania”,“geranium”,“globe_thistle”,“great_masterwort”,“hibiscus”,“hippeastrum”,“japanese_anemone”,“lotus”,“magnolia”,“mallow”,“mexican_petunia”,“monkshood”,“morning_glory”,“orange_dahlia”,“osteospermum”,“passion_flower”,“petunia”,“pincushion_flower”,“pink-yellow_dahlia”,“pink_primrose”,“primula”,“prince_of_wales_feathers”,“red_ginger”,“rose”,“ruby-lipped_cattleya”,“silverbush”,“spear_thistle”,“spring_crocus”,“sunflower”,“sword_lily”,“thorn_apple”,“toad_lily”,“tree_mallow”,“water_lily”]

【训练信息】

参数


训练集图片数

18162

验证集图片数

1730

训练map

91.0%

训练精度(Precision)

87.3%

训练召回率(Recall)

87.6%

【训练数据集(数据集有优化可能与模型训练数量存在差异)】


【部分实现源码】


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文件夹下面)