Skip to content

Varuni08/Fall-Detection-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Fall Detection System

A computer vision system that detects potential human falls from video using YOLOv8 pose estimation and body-keypoint analysis. The project includes real-time fall alerts and a benchmark comparing PyTorch and ONNX inference performance.

Features

  • Human pose detection using YOLOv8 Pose
  • Real-time video frame processing
  • Fall detection based on body orientation and pose geometry
  • Timestamped fall alerts
  • Support for recorded video input
  • PyTorch and ONNX inference benchmarking
  • FPS and inference speed comparison

Project Structure

Fall-Detection/
├── fall_detector.py
├── export_benchmark.py
├── benchmark_results.txt
├── requirements.txt
└── .gitignore

Model weights, test videos, generated alerts, and exported ONNX files are excluded from Git because they are large or generated locally.

Installation

Install the required dependencies:

pip install -r requirements.txt

Model Setup

Download the YOLOv8 Nano Pose model through Ultralytics or allow the library to download it automatically:

from ultralytics import YOLO

model = YOLO("yolov8n-pose.pt")

Usage

Place a test video in the project directory and update the video path inside fall_detector.py.

Run the detector:

python fall_detector.py

Press Q to stop video processing.

Detected fall events are written locally to:

fall_alerts.txt

ONNX Export and Benchmark

Run the benchmark script:

python export_benchmark.py

The script:

  • loads the PyTorch pose model
  • exports or loads the ONNX version
  • processes sample video frames
  • compares inference speed
  • calculates FPS and ONNX speedup

Technology Stack

  • Python
  • OpenCV
  • NumPy
  • Ultralytics YOLOv8 Pose
  • PyTorch
  • ONNX Runtime

Applications

  • Elder-care monitoring
  • Hospital patient safety
  • Workplace safety systems
  • Assisted-living environments
  • Smart surveillance
  • Emergency alert systems

Disclaimer

This project is a proof of concept and should not be used as the sole mechanism for emergency response or medical monitoring without further validation and testing.

About

Real-time fall detection using YOLOv8 pose estimation, geometric posture analysis, timestamped alerts, and PyTorch versus ONNX benchmarking.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages