Skip to main content

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

  1. Install:
pip install Fight-Detection
pip install pytube
  1. 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)
  1. Show the Output Video with Detection:
from moviepy.editor import *
VideoFileClip(outputPath, audio=False, target_resolution=(300,None)).ipython_display()
  1. To Start Detect the Fight on Streaming
start_streaming(streamingURL)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Fight Detection-0.0.3.tar.gz (42.7 MB view hashes)

Uploaded Source

Built Distribution

Fight_Detection-0.0.3-py3-none-any.whl (42.7 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page