Skip to main content

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
Fight_utils.start_streaming(streamingURL)

Metadata

Release files for Fight-Detection 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Fight-Detection 0.0.8
File Size Uploaded
Fight Detection-0.0.8.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Fight-Detection 0.0.8
File Interpreter ABI Platform
Fight_Detection-0.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / Fight Detection-0.0.8.tar.gz

Download URL Fight Detection-0.0.8.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4c365b3da023aea6686ed3611d505b853f774d8906bfef2fa1b55c33f16e6794
BLAKE2b-256 checksum
How to use checksums
19ee6a2b42c3be1e03fe6fbafe74571bbb69d35acbd283d78f16cc03e577286c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / Fight_Detection-0.0.8-py3-none-any.whl

Download URL Fight_Detection-0.0.8-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa62358db62ec0d6937a3568505a973fa480ab4a5d0a811dd23e3c647c6d296f
BLAKE2b-256 checksum
How to use checksums
6b947ba8dbd9ddef819077c4ed81e9af8bd4e262f0ae50c9138e79e6a14a2929
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page