Downloads · 30 days
0
Musawer14/fight_detection_yolov8
fight_detection_yolov8 is a machine learning model from Musawer14. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This repository contains a dataset and YOLOv8 models (nano and small) trained to detect fights/violence and non-violence/no-fight in both videos and images. The models are optimized for surveillance and security appli…
Downloads · 30 days
0
Access
Public
Updated Sep 20, 2024
Repo size
28.8 MB
Likes
5
Public
Click a slice to open those files.
.pt28.8 MB · 100%
From the Hugging Face model README
This repository contains a dataset and YOLOv8 models (nano and small) trained to detect fights/violence and non-violence/no-fight in both videos and images. The models are optimized for surveillance and security applications where detecting physical confrontations is crucial.
Dataset Classes: The dataset consists of two classes:
Data Format:
The models are trained to accurately detect violent events in various settings, including crowds, public spaces, and sports activities.
Clone the Repository:
git clone (https://github.com/Musawer1214/Fight-Violence-detection-yolov8)
cd <repository-directory>
Install Dependencies:
pip install -r requirements.txt
Run Single Class Detection (Violence/Fight): The provided script detects only the Violence/Fight class in both videos and images.
python detect.py --weights best.pt --source <input-video-or-image-path> --class 1 --save-txt
Replace <input-video-or-image-path> with the path to the video or image you wish to analyze. The class ID for Violence/Fight is 1.
Model Weights:
best.pt file contains the pre-trained YOLOv8-nano or YOLOv8-small model optimized for detecting violence/fights.This project is licensed under the MIT License.