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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file Fight Detection-0.0.3.tar.gz.

File metadata

  • Download URL: Fight Detection-0.0.3.tar.gz
  • Upload date:
  • Size: 42.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.6

File hashes

Hashes for Fight Detection-0.0.3.tar.gz
Algorithm Hash digest
SHA256 895bd18612b71ba1f9cb4fb5f0c49f49071e57a52dd4a34dada8b3bbf6cfd2ba
MD5 a9c975a368942b8441a7d5edee42c361
BLAKE2b-256 fe6a1d09cd8e22b9be5f02914222d5d078393e550f10c10f3b6deda2895dea0d

See more details on using hashes here.

File details

Details for the file Fight_Detection-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: Fight_Detection-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 42.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.6

File hashes

Hashes for Fight_Detection-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0bc1b776a3358dfc80d6183a061d6b2d493538be7ed854070b288b71ee0b9722
MD5 b157529d535783d3deb0ff8d1ca3b6d8
BLAKE2b-256 3418c0d14ec544364e2dc9118df63516f5667316a6b23c84e4eea1e38155d35b

See more details on using hashes here.

Supported by

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