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
Fight_utils.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
File details
Details for the file Fight Detection-0.0.8.tar.gz
.
File metadata
- Download URL: Fight Detection-0.0.8.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c365b3da023aea6686ed3611d505b853f774d8906bfef2fa1b55c33f16e6794 |
|
MD5 | ea9584f50dcd323005ac6f4f542dd2d4 |
|
BLAKE2b-256 | 19ee6a2b42c3be1e03fe6fbafe74571bbb69d35acbd283d78f16cc03e577286c |
File details
Details for the file Fight_Detection-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: Fight_Detection-0.0.8-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa62358db62ec0d6937a3568505a973fa480ab4a5d0a811dd23e3c647c6d296f |
|
MD5 | 05636c24ee57dadd400acf2910cdedc7 |
|
BLAKE2b-256 | 6b947ba8dbd9ddef819077c4ed81e9af8bd4e262f0ae50c9138e79e6a14a2929 |