Skip to content

Shahinshac/SentryVision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SentryVision - AI-Powered Threat Detection System

Python YOLOv8 Flask OpenCV

Overview

SentryVision is an advanced AI-powered security monitoring system that provides real-time weapon detection using YOLOv8m deep learning models. The system offers live camera streaming, intelligent threat detection, and comprehensive alert management through a modern web interface.

🚀 Key Features

  • 🎯 Advanced Threat Detection: Custom-trained YOLOv8m model with 47.08% mAP@0.5 for detecting knives, pistols, and long weapons
  • 📹 Multi-Camera Support: Real-time streaming from multiple camera sources with DirectShow backend support
  • ⚡ Intelligent Filtering: Per-class confidence thresholds to reduce false positives (phones/pens detected as knives)
  • 🔐 User Authentication: Secure login and registration system with Flask-Login
  • 🚨 Real-Time Alerts: Instant notifications with detection snapshots and audio alerts
  • 📱 Responsive Dashboard: Modern web interface optimized for desktop and mobile devices
  • 🔧 GPU Acceleration: CUDA-optimized training and inference for RTX GPUs
  • 📊 Performance Monitoring: Comprehensive model evaluation and training metrics

Project Structure

├── instance/                  # SQLite database and other instance-specific files
├── static/                    # Static files (CSS, JS, images, snapshots)
│   ├── snapshots/             # Directory for storing detection snapshots
│   ├── bg.jpg                # Background image for UI
│   └── alert.mp3             # Sound for alert notifications
├── templates/                 # HTML templates for Flask
│   ├── index.html            # Main dashboard
│   ├── login.html            # Login page
│   ├── register.html         # Registration page
│   └── alerts.html           # Standalone alerts page
├── camera_processor.py       # Handles camera processing and YOLO detection
├── config.py                 # Configuration settings
├── forms.py                  # Flask-WTF forms for authentication
├── main.py                   # Main Flask application
├── models.py                 # SQLAlchemy database models
├── requirements.txt          # Python dependencies
└── README.md                 # This file

Installation

  1. Clone the Repository:

    git clone https://github.com/hibaanwer07/SentryVision.git
    cd flask-security-monitoring
  2. Set Up a Virtual Environment:

    python -m venv venv
    source venv\Scripts\activate
  3. Install Dependencies:

    pip install -r requirements.txt
  4. Configure Environment Variables (create .env file):

    SECRET_KEY=your-secret-key
    DATABASE_URL=sqlite:////path/to/site.db
    MAIL_USERNAME=your-email@gmail.com
    MAIL_PASSWORD=your-app-password
  5. Initialize the Database:

    flask db init
    flask db migrate
    flask db upgrade

Running the Application

  1. Start the Flask Server:

    python main.py

    Access the dashboard at http://localhost:5000.

  2. Toggle Security Modes and view live feeds and alerts.


Configuration

  • Camera Sources: Add webcam indices or RTSP URLs in config.py.
  • Threat Classes: Modify PRIMARY_THREAT_CLASSES for detection.
  • Alert Settings: Adjust alert intervals for email and real-time updates.
  • MQTT Settings: Configure MQTT broker for IoT integration.

Contributing

  1. Fork the repository.
  2. Create a branch (git checkout -b feature/your-feature).
  3. Commit changes (git commit -m 'Add feature').
  4. Push to the branch (git push origin feature/your-feature).
  5. Open a Pull Request.

License

This project is licensed under the MIT License.


Acknowledgments

  • YOLOv8: For object detection.
  • Flask: For the web framework.
  • OpenCV: For video processing.
  • Paho MQTT: For MQTT integration.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors