Skip to content

tanpinxi/cs4243-weapons-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weapons Detection Project

This repo details the work done the module project of NUS CS4243 Computer Vision and Pattern Recognition.

Problem Statement

Given a video or image dataset, we are required to develop an algorithm to classify between 3 classes:

  1. carrying (a weapon is being carried)
  2. normal (no weapon is seen)
  3. threat (a weapon based on threat can be detected)

Task Formulation

Given a video for classification, we extract its image and audio data.

For image data, we apply YOLO v5 to extract the cropped bounding boxes of the detected human.

For audio data, we apply librosa to extract the mel spectrum.

Our Implementation

Data Processing

  1. Image Processing
    We perform data cleaning of the image dataset by iterating through each the given dataset for normal, carrying and threat class. For each class, after applying YOLO, we are able to filter out images without a person inside. The implementation can be found here.
  2. Audio Processing
    For every video from a class, the extracted mel spectrum from librosa is saved. The implementation can be found here.
  3. Data Splitting
    We split the dataset such that given a video, if its frames are being used for training, its mel spectrum is also used for training. The same mechanism applies for validation and testing. The implementation can be found here.

Training

In training directory, you can find the scripts for training for images, training for audio and ensemble testing.

Demo

In demo directory, you can find our original video for demo and the output video with class annotation in all of its frames.

You can try with other video by changing the video_name variable in demo/demo.ipynb.

About

Detection of weapon threats via YOLO and InceptionV3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published