Sjmuita / Sentinel-Real-Time-Weapon-Detection-and-Facial-Recognition-System-

This application uses YOLOv5 for weapon detection and Haar Cascade for facial recognition, capturing webcam feeds to detect threats. It sends real-time email alerts and logs events with timestamps and locations to enhance public safety.
0 stars 1 forks source link

Sentinel

This application uses YOLOv5 for weapon detection and Haar Cascade for facial recognition, capturing webcam feeds to detect threats. It sends real-time email alerts and logs events with timestamps and locations to enhance public safety.

Real-Time Weapon Detection and Facial Recognition System

Overview

This project aims to enhance public safety by developing a real-time weapon detection and facial recognition system. Utilizing YOLOv5 for weapon detection and a Haar Cascade model for facial recognition, this application is designed to monitor webcam feeds, detect weapons and faces, and send real-time alerts. Alerts are also logged with timestamps and locations in a CSV file.

Features

Installation

  1. Clone the Repository

    git clone https://github.com/yourusername/weapon-detection-facial-recognition.git
    cd weapon-detection-facial-recognition
  2. Set Up Environment

    Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. Download YOLOv5 and Haar Cascade Models

    • YOLOv5: Clone the YOLOv5 repository into your project directory:

      git clone https://github.com/ultralytics/yolov5.git
    • Haar Cascade: Download the Haar Cascade XML file from the OpenCV repository or use the one provided in the models directory.

  5. Configure Email Alerts

    Update the config.py file with your Gmail credentials and other configuration details:

    EMAIL_ADDRESS = 'your-email@gmail.com'
    EMAIL_PASSWORD = 'your-password'

Usage

  1. Run the Application

    CSV FILE.py
  2. Stop the Application

    The application can be terminated manually or based on elapsed time.

Code Structure

Challenges and Solutions

Future Work

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.


Disclaimer: This project is for educational and research purposes only. Ensure to comply with all local laws and regulations related to surveillance and privacy.