Detect Fight From Surveillance Cameras and Video Streams
Project description
Fight Detection Package
Abstract
Human action recognition can be seen as the automatic labeling of a video according to the actions occurring in it. It has become one of the most challenging and attractive problems in the pattern recognition and video classification fields. The problem itself is difficult to solve by traditional video processing methods because of several challenges such as the background noise, sizes of subjects in different videos, and the speed of actions.Derived from the progress of deep learning methods, several directions are developed to recognize a human action from a video, such as the long-short-term memory (LSTM)-based model, two-stream convolutional neural network (CNN) model, and the convolutional 3D model. Human action recognition is used in some surveillance systems and video processing tools. Our main problem is Fight Detection which we achieved to solve by using transfer learning on pretrained convolutional 3D models that aim to recognize the motions and actions of humans. All models use Kinetics-400 dataset for the pretrained part and Vision-based Fight Detection From Surveillance Cameras dataset for the finetuned part.
Results
Model | Top-1 Accuracy | Batch Size (Videos) | Input Frames | Inference Time (Videos/sec) |
---|---|---|---|---|
r2plus1d_18 | 82.22% | 4 | 16 | 11.3 |
r3d_18 | 88.89% | 4 | 16 | 11.3 |
mc3_18 | 91.11% | 4 | 16 | 11.3 |
mc3_18 | 91.11% | 8 | 16 | 11.3 |
mc3_18 | 83.72% | 4 | 32 | 5.63 |
Pytorch Pretrained Models
All pretrained models can be found in this link. lhttps://pytorch.org/vision/stable/models.html
Instructions to Install our Fight Detection Package
- Install:
pip install Fight-Detection
pip install pytube
- Detect Fight or Not by Pass your Local Video:
from fight_detection import Fight_utils
# Run the Below Function by Input your Test Video Path to get the outPut Video with Fight Detection or Not
Fight_utils.fightDetection(inputPath,seq,skip,outputPath,showInfo)
- Show the Output Video with Detection:
from moviepy.editor import *
VideoFileClip(outputPath, audio=False, target_resolution=(300,None)).ipython_display()
- To Start Detect the Fight on Streaming
start_streaming(streamingURL)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Fight_Detection-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bc1b776a3358dfc80d6183a061d6b2d493538be7ed854070b288b71ee0b9722 |
|
MD5 | b157529d535783d3deb0ff8d1ca3b6d8 |
|
BLAKE2b-256 | 3418c0d14ec544364e2dc9118df63516f5667316a6b23c84e4eea1e38155d35b |