The YOLO (You Only Look Once) series of object detection models are known for their real-time performance and accuracy. In this project, we will be using YOLOv5 to detect guns and knives in CCTV footage in real-time. This project is a proof-of-concept for using YOLOv5 in a security setting to improve public safety.
NVIDIA GPU
CUDA and cuDNN (version 10.2)
Python 3.8 or later
OpenCV
PyTorch
YOLOv5
A dataset of CCTV footage containing guns and knives
Installation
Install CUDA and cuDNN. You can find the installation instructions on the NVIDIA website.
> git clone https://github.com/AlexeyAB/darknet
> pip install -r requirements.txt
> https://github.com/AlexeyAB/darknet
> cd darknet
> make
-
Collect CCTV footage containing guns and knives.
-
Run the object detection script on the CCTV footage.
> python detect.py --input path/to/video.mp4 --output path/to/output.avi --weights path/to/weights.pt
The script will detect guns and knives in the footage and save the output to the specified location.