dusme_1.2.mp4
This video demonstrates automatic fall detection and extraction from the original video
This project detects people in videos using YOLOv8 and analyzes their posture with MediaPipe. When a fall is detected, the falling moment is automatically clipped from the video and saved as a separate file.
Key Features:
- Detects humans in video frames using YOLOv8
- Analyzes body posture through MediaPipe pose estimation
- Calculates torso angle based on shoulder and hip positions
- Automatically clips and saves fall moments from the video
- Person Detection: YOLOv8 detects people in each frame
- Posture Analysis: MediaPipe calculates the torso angle using shoulder and hip landmarks
- Fall Classification: If the torso angle exceeds a threshold, the person is classified as falling
- Automatic Clipping: Fall moments are automatically extracted and saved as separate video files
pip install numpy==2.1.0 opencv-python==4.10.0.84 ultralytics==8.2.81 mediapipe==0.10.14 collection==0.1.6python main.pyNote
On first run, YOLOv8 will automatically download the yolov8n.pt model file (~6MB). Internet connection required for initial setup.
Important
If you encounter this error:
ValueError: while processing the input streams of subgraph node InferenceCalculator:
TAG:index:name is invalid...
This issue occurs when your system locale is set to Turkish. MediaPipe requires English locale.
Solution:
-
Edit locale configuration:
sudo nano /etc/locale.gen
-
Enable English and disable Turkish:
- Remove
#fromen_US.UTF-8 UTF-8 - Add
#totr_TR.UTF-8 UTF-8
- Remove
-
Update locale:
sudo update-locale LANG=en_US.UTF-8
-
Reboot:
sudo reboot
Bu proje, YOLOv8 kullanarak videodaki insanları tespit eder ve MediaPipe ile duruş analizi yapar. Düşme tespit edildiğinde, düşme anı otomatik olarak videodan kırpılır ve ayrı bir dosya olarak kaydedilir.
Temel Özellikler:
- YOLOv8 ile video karelerinde insan tespiti
- MediaPipe ile vücut duruşu analizi
- Omuz ve kalça pozisyonlarına göre gövde açısı hesaplama
- Düşme anlarının otomatik olarak kırpılması ve kaydedilmesi
- İnsan Tespiti: YOLOv8 her karede insanları tespit eder
- Duruş Analizi: MediaPipe omuz ve kalça işaretleyicilerini kullanarak gövde açısını hesaplar
- Düşme Sınıflandırması: Gövde açısı belirli bir eşiği aştığında kişi düşüyor olarak sınıflandırılır
- Otomatik Kırpma: Düşme anları otomatik olarak ayıklanır ve ayrı video dosyaları olarak kaydedilir
pip install numpy==2.1.0 opencv-python==4.10.0.84 ultralytics==8.2.81 mediapipe==0.10.14 collection==0.1.6python main.pyNote
İlk çalıştırmada YOLOv8 otomatik olarak yolov8n.pt model dosyasını indirecektir (~6MB). İlk kurulum için internet bağlantısı gereklidir.
Important
Şu hatayı alıyorsanız:
ValueError: while processing the input streams of subgraph node InferenceCalculator:
TAG:index:name is invalid...
Bu sorun, sistem dilinizin Türkçe olmasından kaynaklanır. MediaPipe İngilizce yerel ayar gerektirir.
Çözüm:
-
Dil yapılandırmasını düzenleyin:
sudo nano /etc/locale.gen
-
İngilizce'yi etkinleştirin, Türkçe'yi devre dışı bırakın:
en_US.UTF-8 UTF-8satırından#işaretini kaldırıntr_TR.UTF-8 UTF-8satırına#ekleyin
-
Dil ayarlarını güncelleyin:
sudo update-locale LANG=en_US.UTF-8
-
Bilgisayarı yeniden başlatın:
sudo reboot