Skip to content

yasarkar/Face-Mask-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ FaceGuard AI: Enterprise Face Mask Detection System

FaceGuard AI is a robust, real-time computer vision solution designed to automate health safety compliance in public spaces. Leveraging Transfer Learning (MobileNetV2) and OpenCV, the system delivers high-accuracy face mask detection with minimal latency, making it suitable for deployment on standard CPUs and edge devices.

📋 Executive Summary

  • Objective: To replace manual mask checking with an automated, contactless AI system.
  • Core Technology: Deep Learning (MobileNetV2) & Haar Cascade Classifiers.
  • Performance: ~98.5% Accuracy with Real-Time Inference (30+ FPS).
  • Key Capability: Automatically detects violations, triggers visual alarms, and logs evidence without human intervention.

🚀 Key Features

  1. High-Performance Detection Engine Powered by a fine-tuned MobileNetV2 neural network. Optimized for low computational cost, allowing smooth performance on non-GPU laptops.

  2. Intelligent Violation Logging (Evidence Collection) Auto-Capture: Automatically saves high-resolution snapshots of individuals not wearing masks. Smart Cooldown Logic: Includes a 10-second cooldown mechanism to prevent disk flooding while capturing persistent violations. Unicode Support: Features a custom file-saving engine to handle file paths with special characters (e.g., 'Masaüstü', 'Şirket') on Windows systems.

  3. Professional HUD (Head-Up Display) Real-time dashboard displaying FPS, Total Faces Detected, and Violation Counts. Visual Alarm: The interface flashes RED borders immediately upon detecting a violation.

  4. Self-Healing Architecture Dynamic Path Configuration: The system automatically detects its root directory, allowing the script to run from src or the project root without path errors. Auto-Recovery: Automatically downloads missing dependencies (e.g., Haarcascade XML) and regenerates configuration files if deleted.

📂 System Architecture

The project adheres to industry-standard data science project structure:

FaceMaskProject/ │ ├── notebooks/ # Training Environment │ └── FaceMaskDetection.ipynb # Training Pipeline Source │ ├── data/ # Raw Dataset (Train, Val, Test) │ ├── src/ # Deployment Source Code │ └── webcam_demo.py # Real-Time Inference Script │ ├── outputs/ # Generated Artifacts (Auto-Created) │ ├── models/ # Serialized Models (.keras) │ ├── config/ # System Configs (JSON, XML) │ ├── figures/ # Performance Graphs & Confusion Matrices │ └── logs/ # Violation Snapshots for webcam (Evidence) 📸 │ ├── reports/ # Documentation │ └── facemaskdetection.pdf # Final Project Report │ ├── README.md # Project Overview & Instructions └── requirements.txt # Dependency Manifest

💻 Installation & Usage

Follow the steps below to set up and run the FaceGuard AI system on your local machine. This system is optimized for Python 3.10. To ensure stability and avoid dependency conflicts, it is highly recommended to run this project in a Python 3.10 environment.

  1. Setup & Installation

Open your terminal or command prompt and follow these steps:

Step A: Create a Virtual Environment It is best practice to run the system in an isolated environment. Navigate to the project directory and create a virtual environment:

  1. Navigate to the project directory cd FaceMaskProject

  2. Create a virtual environment using Python 3.10 (If 'python' on your system is already 3.10, you can just use 'python') python3.10 -m venv venv

  3. Activate the virtual environment For Windows: .\venv\Scripts\activate For macOS / Linux: source venv/bin/activate

Step B: Install Dependencies Once the virtual environment is active (you should see (venv) in your terminal), install the required packages: pip install -r requirements.txt

Step C: Run the System Navigate to the src directory and run the webcam demo: cd src python webcam_demo.py

⚠️Controls & Outputs Webcam: The system will automatically access your default webcam. Quit: Press 'q' on your keyboard to stop the program and close the window. Logs: Snapshots of detected violations are automatically saved to the outputs/logs/ directory.

About

OpenCV, TensorFlow ve MobileNetV2 kullanılarak geliştirilen gerçek zamanlı yüz maskesi tespit sistemi. Canlı video akışı üzerinden %98 doğrulukla temassız maske kontrolü yapar ve kural ihlallerini otomatik olarak tespit eder.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors