Skip to content

Training YOLOv8 on Falling Dataset to Enable Real-Time Fall Detection

Notifications You must be signed in to change notification settings

pahaht/YOLOv8-Fall-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

YOLOv8-Fall-detection

Overview

This project focuses on training YOLOv8 on a Falling Dataset with the goal of enabling real-time fall detection. It constitutes a comprehensive initiative aimed at harnessing the capabilities of YOLOv8, a cutting-edge object detection model, to enhance the efficiency of fall detection in real-time scenarios.

alt text

Installation

To install YOLOv8, please follow this link, which contains comprehensive documentation that will be beneficial to you: https://docs.ultralytics.com/

Dataset

In this project, I used the Roboflow dataset :https://universe.roboflow.com/hero-d6kgf/yolov5-fall-detection

Training YOLOv8 based on Fall Dataset

-To understand well the training process follow this link :https://docs.ultralytics.com/modes/train/#why-choose-ultralytics-yolo-for-training -To customize YOLOv8 for the fall dataset, run the following command :


from ultralytics import YOLO 
# Load the model.
model = YOLO('yolov8n.pt') 
# Training.
results = model.train(
   data="path to dataset\data.yaml",    
   imgsz=640,
   epochs=100,
   batch=8,)

Use of fall detection pre-trained model

To find the weight(pre-trained model) after training YOLOv8 on a Fall dataset, use the best.pt file, which is automatically stored in the runs/detect/train/weights directory.

Loading fall detection pre-trained model


from ultralytics import YOLO
model = YOLO('weight_path'\f-e-100.pt') # f-e-100.pt it is the weight (best.pt I change to f-e-100)

Model Evaluation

Correlogram


from IPython.display import Image
# Display the image
Image(input image path\runs\detect\train3\labels_correlogram.jpg', width=600)

Prediction(1)


# Prediction fall detection
from PIL import Image
# from PIL
im1 = Image.open("input image_path")
results = model.predict(source=im1, save=True)  

Display predicted image(1)


display(Image.open('runs/detect/predict5/c8.jpg'))

About

Training YOLOv8 on Falling Dataset to Enable Real-Time Fall Detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages