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.
- 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
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.
Install the required dependencies:
pip install -r requirements.txtDownload the YOLOv8 Nano Pose model through Ultralytics or allow the library to download it automatically:
from ultralytics import YOLO
model = YOLO("yolov8n-pose.pt")Place a test video in the project directory and update the video path inside fall_detector.py.
Run the detector:
python fall_detector.pyPress Q to stop video processing.
Detected fall events are written locally to:
fall_alerts.txt
Run the benchmark script:
python export_benchmark.pyThe script:
- loads the PyTorch pose model
- exports or loads the ONNX version
- processes sample video frames
- compares inference speed
- calculates FPS and ONNX speedup
- Python
- OpenCV
- NumPy
- Ultralytics YOLOv8 Pose
- PyTorch
- ONNX Runtime
- Elder-care monitoring
- Hospital patient safety
- Workplace safety systems
- Assisted-living environments
- Smart surveillance
- Emergency alert systems
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.