YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Weapon Detection System using YOLOv8
Overview
This project is a weapon detection system built using Deep Learning and Computer Vision. It detects guns in images using the YOLOv8 object detection model. The system is trained on a custom dataset named weapon-detection-test.
Dataset
- Dataset Name: weapon-detection-test
- Type: Labeled images dataset for weapon detection
- Source: Kaggle-based dataset
Model Used
- YOLOv8
- Pre-trained weights fine-tuned on custom dataset
- Trained for 50 epochs
Training Details
- Epochs: 50
- Task: Object Detection (Gun detection only)
- Input: Images
- Output: Bounding box around detected gun
Features
- Detects guns in images
- High-speed inference using YOLOv8
- Lightweight and efficient model
- Can be extended for real-time detection
Model Files
- Trained YOLOv8 weights are used for prediction
- Model stored externally due to size limits
Download Model: https://drive.google.com/file/d/1wJDPS5R7bhfx5uJORJ4ZPk4JG1VbvLGG/view?usp=sharing
How It Works
- Input image is given to the model
- YOLOv8 processes the image
- Model detects presence of gun
- Output shows bounding box if weapon is found
Limitations
- Currently detects only guns (not other weapons)
- Works only on images (not real-time video yet)
- Performance depends on dataset quality
- May fail on unseen environments or angles
Future Improvements
- Add real-time video detection
- Extend to multiple weapon classes (knife, pistol, etc.)
- Improve dataset diversity
- Deploy as web or mobile application
- Optimize for edge devices (CCTV systems)
How to Use
from ultralytics import YOLO
import cv2
# Download the model file from Link, mentioned in "Model Files" Section.
# Load trained model
model = YOLO("weapon_detector.pt")
# Load image
image_path = "test.jpg"
img = cv2.imread(image_path)
# Run detection
results = model(image_path)
# Show results
results[0].show()
# Optional: save output image
results[0].save("output.jpg")
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support