A real-time weapon detection system built using YOLOv5, OpenCV, and PyTorch.
The system detects weapons such as guns and knives from a live camera feed and can be extended for surveillance and security applications.
- 🎥 Real-time weapon detection using webcam / IP camera
- 🧠 Deep Learning–based object detection (YOLOv5)
- ⚡ Fast inference with PyTorch
- 📦 Lightweight and modular codebase
- 🔒 Suitable for surveillance & safety systems
- Python
- PyTorch
- YOLOv5
- OpenCV
- Computer Vision
Weapon-Detection-System/
│
├── final_live.py # Main script for real-time detection
├── requirements.txt # Python dependencies
├── .gitignore # Ignored files & folders
├── README.md # Project documentation
└── weights/
└── best_weapon.pt # (Not included – download separately)
The trained YOLOv5 model (best_weapon.pt) is not included in this repository due to GitHub file size limits.
The repository excludes the model file due to GitHub file size limits.
🔗 https://drive.google.com/file/d/1xUckP056SLF14MkdGqXUWTacxH-FFW9r/view?usp=drive_link
Weapon-Detection-System/
└── weights/
└── best_weapon.pt
git clone https://github.com/gowthamx25/Weapon-Detection-System.git
cd Weapon-Detection-System
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
python final_live.py
Press Q to exit the live detection window.
- Bounding boxes around detected weapons
- Class labels (e.g., gun, knife)
- Confidence scores
This project is for educational and research purposes only. It should not be solely relied upon for real-world security decisions without proper validation and legal approval.
- 🔊 Audio alerts on weapon detection
- 📹 CCTV / IP camera integration
- ☁️ Cloud-based monitoring dashboard
- 🧠 Improved model accuracy with custom datasets
- 📱 Mobile & edge deployment (Jetson / Raspberry Pi)
Gowtham S
AI & Computer Vision Enthusiast
GitHub: https://github.com/gowthamx25
If you find this project useful:
⭐ Star the repository
🍴 Fork it
🧠 Contribute improvements