Skip to content

aayushgzip/Fall_detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧍‍♂️ Fall Detection System 🚨

A real-time fall detection system using YOLOv8, OpenCV, and SMTP-based email alerts.
Detects human falls in video or webcam feeds and notifies via email with a captured frame.

Python YOLOv8 OpenCV SMTP


✨ Features

  • 🎯 Accurate Detection using YOLOv8 (yolov8s or yolov8m)
  • 🧍 Person Tracking with unique IDs & position history
  • ⚠️ Fall Detection Logic based on:
    1. Aspect Ratio (detect lying down)
    2. Sudden Vertical Motion
    3. Screen Position (proximity to floor)
  • 📸 Email Alert with captured image via Brevo SMTP
  • 📹 Video File & Live Webcam Modes
  • ⚙️ Configurable Thresholds and detection sensitivity

🛠️ Requirements

Install dependencies with:

pip install ultralytics opencv-python cvzone numpy

▶️ Usage

📼 Run with default video:

python fall_detection.py

🎥 Run with live webcam:

python fall_detection.py live

🎮 Controls

Key Action
`q` Quit the program
`s` Switch video/live mode
`r` Reset fall detection

📧 Email Configuration

Uses Brevo SMTP for sending alerts.

In the script, update:

TO_EMAIL = '[email protected]'  # Replace with actual email

Make sure SMTP settings (username, password, or app password) are correctly configured.


📝 Notes

  • Compatible with any YOLOv8 model (`yolov8s.pt`, `yolov8m.pt`, etc.)
  • Video will restart automatically after ending.
  • Detection thresholds are configurable for sensitivity tuning.

🤝 Contributing

Pull requests, improvements, and feature additions are welcome!

About

a fall detection pipeline using python and yolo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages