Skip to main content

Car Crash Detection Package


Abstract

Car Crash Detection can be seen as the Detection of Accident or Not in a video according to the actions occurring in it. It has become one of the most challenging and attractive problems in video classification and detection 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 Cars.Derived from the progress of deep learning methods, several directions are developed for video detection, such as the long-short-term memory (LSTM)-based model, two-stream convolutional neural network (CNN) model, and the convolutional 3D model. Car Crash Detection is used in some surveillance systems and video processing tools. Our main problem is Accident Detection which we achieved to solve by using transfer learning on pretrained convolutional 3D models that aim to recognize the motions and actions of Cars. All models use Kinetics-400 dataset for the pretrained part and Vision-based Accident Detection From Surveillance Cameras dataset for the finetuned part.

Pytorch Pretrained Models

All pretrained models can be found in this link. lhttps://pytorch.org/vision/stable/models.html

Instructions to Install our Car Crash Detection Package

  1. Install:
pip install Car-Crash-Detection
pip install pytube
  1. Download the Finetunned Model Weights
import gdown
url = 'https://drive.google.com/uc?id=1-8TyT7MkAS7LLsRTbO03tDsuuoBM6q1D'
model = 'model_ft.pth'
gdown.download(url, model, quiet=False)
  1. Detect Accident or Not by Pass your Local Video:
from car_crash_detection import CrashUtils
# Run the Below Function by Input your Test Video Path to get the outPut Video with Accident Detection or Not
CrashUtils.crashDetection(inputPath,seq,skip,outputPath,showInfo=False,thresholding=0.85)
  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 Accident on Streaming
CrashUtils.start_streaming(streamingURL,thresholding=0.85)

Metadata

Release files for Car-Crash-Detection 0.0.5

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

Source distribution (sdist)

Source distribution for Car-Crash-Detection 0.0.5
File Size Uploaded
Car Crash Detection-0.0.5.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Car-Crash-Detection 0.0.5
File Interpreter ABI Platform
Car_Crash_Detection-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / Car Crash Detection-0.0.5.tar.gz

Download URL Car Crash Detection-0.0.5.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
735b1a728286e5775732c40152d53212f4a3cb18e0218875d98ef20ca106ec3f
BLAKE2b-256 checksum
How to use checksums
5daf130041edefe39eba076b3064fd3f2b34ab9b185a8cb52d097e59271503d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.6

Release files / Car_Crash_Detection-0.0.5-py3-none-any.whl

Download URL Car_Crash_Detection-0.0.5-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d613e4d97481f49e433e140195730c601353819a778a5916a5f7424a647e54fb
BLAKE2b-256 checksum
How to use checksums
85f828e201a2cfdb2bbfa26448dfcb0b794d687ce6178727b400219fd317cac7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

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