基于 yolov8的火焰检测

Fire and Smoke Tracking and Detection using YOLOv8

Introduction

This repository contains the code for tracking and detecting fires and smokes in real-time video using YOLOv8. The project uses a pre-trained YOLOv8 model to identify the presence of fire and smoke in a given video frame and track it through subsequent frames.

https://user-images.githubusercontent.com/22887323/216410880-297f4408-8d22-47a1-b894-6f3f3d8109fb.mp4

The following packages are required to run the code

ultralytics
roboflow
CUDA (if using GPU for acceleration)

Steps to train on custom dataset

  1. Install YOLOv8
  2. CLI Basics
  3. Inference with Pre-trained COCO Model
  4. Roboflow Universe
  5. Preparing a custom dataset
  6. Custom Training
  7. Validate Custom Model
  8. Inference with Custom Model

Custom data

Used roboflow to annotate fire and smoke images.
Sample notebook show how we can add the Roboflow workflow project using API to download the annotated dataset to train the model.
Use the below code to download the datset:

from roboflow import Roboflow
rf = Roboflow(api_key="xxxxxxxxxxxxxxxx")
project = rf.workspace("custom-thxhn").project("fire-wrpgm")
dataset = project.version(8).download("yolov8")

Evaluation

The below chart show the loss , mAP (mean Average Precision) score for the train, test,validation set.

confusion Matrix :

Inference

Run the model using below command:

!yolo task=detect mode=predict model=<path to weight file> conf=0.25 source=<path to source image or video> save=True

The --source argument is required to specify the path to the input video. the above command save your weight in run/predict, which will contain the annotated frames with fire and smoke detections.

Result

The project can detect fire and smoke in real-time video with high accuracy. The detection and tracking performance can be improved by fine-tuning the YOLOv8 model on a custom dataset.
It can be used as a starting point for more advanced projects and can be easily integrated into a larger system for fire and smoke monitoring.

References

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

墨痕_777

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值