Skip to content

A real-time fire and smoke detection system that leverages YOLOv11 for object detection and OpenCV for video stream processing.

Notifications You must be signed in to change notification settings

Ne4nf/FireSmokeDetect_with_TELE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”₯πŸ’¨ Fire Smoke Detection & Telegram Alert System

πŸ“– Overview

This project is a real-time fire and smoke detection system that leverages YOLOv11 for object detection and OpenCV for video stream processing. The system continuously analyzes video streams (from a webcam or saved footage), detects fire and smoke, draws bounding boxes with labels, and sends annotated snapshots with alerts to a Telegram chat. It is designed to provide early warnings for fire hazards, ensuring quick response and safety.


Demo_Fire01.mp4

Demo_Smoke01.mp4

πŸš€ Features

  • Real-Time Detection: Detects fire and smoke in video streams with high accuracy using YOLOv11.
  • Motion Detection: Filters frames based on motion detection to reduce false positives.
  • Alert System: Sends real-time alerts with annotated images to a Telegram chat.
  • Configurable Sensitivity: Adjust detection confidence threshold and notification frequency.
  • Visualization: Displays the detection results with bounding boxes and labels on the video feed.

πŸ›  Technologies & Libraries

  • Model & Inference:
    • YOLOv11 (Ultralytics)
    • PyTorch, OpenCV
  • Notification:
    • TelegramBot API
  • Data & Annotation:
    • Roboflow for dataset labeling
  • Environment:
    • Python 3.8+
    • Google Colab (training)

βš™οΈ Installation & Setup

1️⃣ Training the Model (Google Colab)

  • Open the Colab Notebook & Run the Fire_detection_Model.ipynb file

  • Download the best.pt file to your local machine for deployment.

2️⃣ Running the Detection Script Locally

  • Setup Local Environment: Ensure you have Python 3.8+ installed.

  • Install required libraries:

pip install python-dotenv opencv-python
  • Prepare Environment Variables

    • Create a .env file in the project root directory with the following content:
TELEGRAM_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
  • Run the Detection Script
python FireSmokeDetection.py
  • Make sure the VIDEO_PATH in the script points to the correct video file.

3️⃣ System Workflow

  • Video Input: Reads video input from a file or webcam.

  • Detection: YOLOv11 detects fire and smoke in the frames, draws bounding boxes, and adds labels.

  • Alert System: Sends annotated frames to Telegram if fire or smoke is detected.

  • User Control: Send /stop to the bot to terminate detection.

4️⃣ Notes

  • GPU in Colab: Ensure you enable GPU acceleration (Runtime > Change runtime type > GPU).

πŸ‘€ Author

Developed by THUC TU


Contact

For any questions or feedback, please contact:

About

A real-time fire and smoke detection system that leverages YOLOv11 for object detection and OpenCV for video stream processing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published