Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
---
|
| 6 |
+
# Fight/Violence Detection in Videos Using 3D CNN
|
| 7 |
+
|
| 8 |
+
This repository contains a dataset and a 3D CNN (Convolutional Neural Network) model trained to detect fights/violence and non-violence in videos. The model is designed to capture temporal and spatial features to identify violent activities, making it suitable for real-time surveillance and security applications.
|
| 9 |
+
|
| 10 |
+
## Dataset Overview
|
| 11 |
+
|
| 12 |
+
- **Dataset Classes:** The dataset consists of two classes:
|
| 13 |
+
1. **Violence/Fight:** Videos where physical violence is present.
|
| 14 |
+
2. **NoViolence/NoFight:** Videos with no physical confrontations.
|
| 15 |
+
|
| 16 |
+
- **Data Format:**
|
| 17 |
+
- The dataset contains videos that are labeled into the above two classes.
|
| 18 |
+
- These videos are preprocessed and split into frames that are fed into the 3D CNN model for training and detection.
|
| 19 |
+
|
| 20 |
+
## Model
|
| 21 |
+
|
| 22 |
+
- **3D CNN Architecture:**
|
| 23 |
+
- The 3D CNN model is trained to detect patterns across both spatial and temporal dimensions, making it ideal for analyzing video sequences.
|
| 24 |
+
- The model uses 3D convolutional layers to capture motion and action-based features, which are crucial for fight/violence detection.
|
| 25 |
+
|
| 26 |
+
## Purpose
|
| 27 |
+
|
| 28 |
+
The model is developed to detect violent actions in video footage. This system can be deployed in surveillance cameras, security systems, or any environment where fight/violence detection is necessary.
|
| 29 |
+
|
| 30 |
+
### Key Features:
|
| 31 |
+
- **Fight/Violence Detection:**
|
| 32 |
+
- The 3D CNN model is trained to recognize fight/violence events in videos, differentiating them from non-violent actions.
|
| 33 |
+
- The model processes video sequences to make predictions, utilizing temporal changes and spatial context.
|
| 34 |
+
|
| 35 |
+
## Code and Usage Instructions
|
| 36 |
+
|
| 37 |
+
### Pre-requisites:
|
| 38 |
+
- Python 3.8 or higher
|
| 39 |
+
- TensorFlow or PyTorch (depending on the implementation)
|
| 40 |
+
- OpenCV
|
| 41 |
+
- FFmpeg (for video preprocessing)
|
| 42 |
+
- Required libraries as mentioned in `requirements.txt`
|
| 43 |
+
|
| 44 |
+
### Video Preprocessing:
|
| 45 |
+
|
| 46 |
+
1. **Extract Frames from Video:**
|
| 47 |
+
The 3D CNN model expects the input as video frames. You can extract frames from videos using the following command:
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
ffmpeg -i <input-video> -vf fps=25 <output-frame-directory>/frame_%04d.jpg
|