Skip to content

๐Ÿง โœจ DetectSafeVisionX ๐ŸŽฏ AI-powered system for real-time detection of ๐Ÿฆบ helmets, ๐Ÿ˜ท face masks, ๐Ÿšฌ smoking, ๐Ÿ”ฅ fire, and ๐Ÿ’จ smoke ๐Ÿ” Smart. Fast. Reliable.

License

Notifications You must be signed in to change notification settings

Amin-moniry-pr7/DetectMultiObject-for-Helmets-Masks-Fire-Smoke-Smoking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ P8GP-G01: Advanced Object Detection System

Version Python Platform License

A real-time safety monitoring system powered by AI and deep learning

๐Ÿ“„ Project Files & Documentation

๐Ÿ“š Essential Files Overview

File Purpose Description
๐Ÿ“„ LICENSE Legal Protection Non-commercial use license preventing unauthorized commercial usage
๐Ÿ“„ .gitignore Version Control Comprehensive exclusion rules for Python, AI models, and temporary files
๐Ÿ“„ README.md Documentation Complete project guide, setup instructions, and feature overview
๐Ÿ“ Project_Picture/ Visual Assets Application screenshots and interface previews for documentation
๐Ÿ“ UI/ Main Application Core application code, models, and resources

๐Ÿ”’ License Information

This project is protected under a Non-Commercial License which:

  • โœ… Permits: Personal use, educational purposes, research, and open-source contributions
  • โŒ Prohibits: Commercial use, business applications, revenue generation, and corporate deployment
  • ๐Ÿ“‹ Requires: Attribution to original authors and license inclusion in distributions

๐Ÿšซ Git Exclusions (.gitignore)

The comprehensive .gitignore file excludes:

  • Python cache files and virtual environments
  • AI model files (*.pt, *.pth) to prevent large file commits
  • Generated detection images and temporary files
  • IDE-specific files and OS-generated files
  • Sensitive configuration and log files

๐ŸŽจ Visual Gallery & Screenshots

๐Ÿ“ฑ Application Interface Preview

The P8GP-G01 system features a modern, intuitive interface designed for seamless safety monitoring:

Main Interface

Screenshot showcasing the main application interface with real-time detection capabilities

๐Ÿ” Key Interface Elements Highlighted:

  • Live Video Feed: Real-time camera stream with detection overlays
  • Detection Status Panel: Visual indicators for safety equipment monitoring
  • Control Dashboard: Comprehensive monitoring and statistics display
  • Interactive Elements: User-friendly buttons and navigation controls

๐Ÿ“ธ More Screenshots: Additional project images and interface previews are available in the Project_Picture/ directory


๐Ÿ“ธ Project Showcase

๐ŸŽฏ Main Application Interface

P8GP-G01 Application

Real-time object detection in action - showcasing helmet, mask, and smoking detection capabilities


๐Ÿ“– Project Overview

P8GP-G01 is a cutting-edge real-time object detection system engineered for safety monitoring applications. Leveraging state-of-the-art YOLO models (YOLOv5n and custom-trained variants), the system provides intelligent detection capabilities for critical safety equipment and hazardous situations including Helmets, Smoking, Fire, Smoke, and Face Masks.

The system features an intuitive PyQt6-powered graphical user interface that delivers seamless user experience with real-time monitoring, automated image saving, and comprehensive detection analytics. Built for cross-platform compatibility, it supports multiple camera sources and includes an elegant animated welcome interface.

โœจ Key Features

๐Ÿ” Real-Time Detection

  • Advanced safety equipment recognition
  • Multi-class object detection (Helmets, Masks, Smoking, Fire, Smoke)
  • High-accuracy YOLO model implementation
  • Real-time confidence scoring

๐Ÿ–ฅ๏ธ Intelligent GUI

  • Modern welcome screen with animations
  • Live video feed with detection overlays
  • Comprehensive control dashboard
  • Interactive image gallery system

๐Ÿ“น Camera Management

  • Universal camera detection (Windows/Linux/macOS)
  • Multiple video source support
  • Automatic device enumeration
  • Platform-optimized camera handling

๐Ÿ’พ Smart Data Management

  • Automated image categorization and saving
  • Organized folder structure by detection type
  • Gallery preview with thumbnail generation
  • Detection statistics and analytics

๐ŸŽฏ Monitoring Capabilities

Detection Type Description Use Case
๐Ÿฆบ Safety Helmets Hard hat and protective headgear detection Construction sites, industrial facilities
๐Ÿ˜ท Face Masks Medical and protective mask identification Healthcare, public safety compliance
๐Ÿšฌ Smoking Detection Cigarette and smoking activity recognition No-smoking zone enforcement
๐Ÿ”ฅ Fire Detection Flame and fire hazard identification Emergency response, safety monitoring
๐Ÿ’จ Smoke Detection Smoke plume and vapor detection Early warning systems

๐Ÿ› ๏ธ Prerequisites & System Requirements

System Requirements

Component Minimum Requirement Recommended
Operating System Windows 10, Linux (Ubuntu 18.04+), macOS 10.15+ Latest stable versions
Python Version Python 3.10+ Python 3.11+
RAM 4 GB 8 GB+
Storage 2 GB free space 5 GB+
Camera USB 2.0 webcam USB 3.0 HD webcam
CPU Dual-core 2.0 GHz Quad-core 2.5 GHz+

Required Software

  • Python 3.10+ (Tested extensively with Python 3.10; compatible with newer versions including 3.12.4)
  • pip (Python package manager)
  • Compatible webcam or video capture device
  • (Optional) Raspberry Pi for embedded deployment

๐Ÿ“š Dependencies

All dependencies are precisely defined in UI/requirements.txt with tested version compatibility:

Core Libraries

torch==2.3.1              # PyTorch deep learning framework
opencv-python==4.9.0.80   # Computer vision and image processing
numpy==1.26.4             # Numerical computing foundation
ultralytics==8.1.0        # YOLOv5/YOLOv8 implementation
PyQt6==6.6.1              # Modern GUI framework (stable as of March 2025)
pygrabber==0.2            # Enhanced Windows camera detection (DirectShow)

Built-in Python Modules

These are included with Python standard library - no installation required:

  • platform - System platform detection
  • os - Operating system interface
  • subprocess - Process management
  • sys - System-specific parameters
  • time - Time-related functions

๐Ÿ“ฆ Installation & Setup Guide

Step 1: Repository Setup

# Clone the repository (if applicable)
git clone <repository-url>
cd P8GP_G01

Step 2: Virtual Environment (Recommended)

# Create isolated environment
python -m venv venv

# Activate environment
# On Windows:
venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate

# Verify activation (prompt should show (venv))

Step 3: Navigate to Project Directory

cd UI

Step 4: Install Dependencies

# Install all required packages
pip install -r requirements.txt

# Verify installation
pip list

Step 5: Model Verification

Ensure all pre-trained models are present in UI/Models/:

Model File Purpose Status
Fire_Detection.pt Fire and flame detection โœ… Required
Helmet_Detection.pt Safety helmet identification โœ… Required
Mask_Detection.pt Face mask detection โœ… Required
Smoking_Detection.pt Smoking activity detection โš ๏ธ Optional (testing)

Note: If model files are missing, contact the development team or download from the official model repository.

Step 6: Directory Structure Verification

Confirm the following structure exists within your project:

P8GP_G01/
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE                        # Non-commercial license file
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore                     # Git exclusion rules
โ”œโ”€โ”€ ๐Ÿ“„ README.md                      # Main documentation
โ”œโ”€โ”€ ๐Ÿ“ Project_Picture/               # Project screenshots
โ”‚   โ””โ”€โ”€ amin1.png                    # Application interface screenshot
โ””โ”€โ”€ ๐Ÿ“ UI/                           # Main application directory
    โ”œโ”€โ”€ ๐Ÿ“ Codes/                    # Python source code
    โ”œโ”€โ”€ ๐Ÿ“ Imgs/                     # Application assets
    โ”‚   โ”œโ”€โ”€ P1.png                  # Welcome background
    โ”‚   โ””โ”€โ”€ icon.png                # App icon
    โ”œโ”€โ”€ ๐Ÿ“ Images/                   # Detection output storage
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ masks/               # Mask detection saves
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Helmets/             # Helmet detection saves
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ smoke/               # Smoke detection saves
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Fire/                # Fire detection saves
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Cigarettes/          # Cigarette detection saves
    โ”‚   โ””โ”€โ”€ ๐Ÿ“ smoking/             # Smoking activity saves
    โ”œโ”€โ”€ ๐Ÿ“ Models/                   # AI model files
    โ”œโ”€โ”€ requirements.txt             # Dependencies
    โ””โ”€โ”€ README.md                    # UI-specific documentation

๐Ÿ“‹ Important: Ensure the Project_Picture/ folder contains your application screenshots for proper documentation display.


๐Ÿš€ Usage Instructions

Launch Application

# Ensure you're in the UI directory
cd UI

# Start the application
python Codes/Application.py

1. Welcome Screen Interaction

  • Startup: Application begins with an animated welcome screen displaying "P8GP-G01"
  • Navigation: Click "Get Started" to proceed to the main detection interface
  • Animation: Enjoy the smooth transition effects and professional branding

2. Main Interface Navigation

๐Ÿ“บ Video Display Panel

  • Live Feed: Real-time camera stream with AI-powered object detection
  • Detection Overlays: Colored bounding boxes around detected objects
  • Confidence Scores: Percentage accuracy displayed for each detection
  • Multi-object Support: Simultaneous detection of multiple object types

๐ŸŽ›๏ธ Control Panel Features

  • Real-time Status: Live detection monitoring with visual indicators
  • Object Counters: Dynamic count of detected objects by category
  • Statistics Table: Comprehensive "Have" vs "Don't Have" metrics
  • Future Plans: Expandable table for additional monitoring features

๐Ÿ“ท Camera Management

  • Active Cameras: Click to browse and select from detected camera devices
  • Multi-platform Detection: Automatic recognition across different operating systems
  • Hot-swapping: Switch between cameras without restarting the application

๐Ÿ–ผ๏ธ Image Management System

  • Save Toggle: Enable/disable "Save Detected Images" functionality
  • Gallery Access: Browse categorized galleries (Masks, Safety Hats, Smoking, Fire, Smoke)
  • Preview Mode: Click any saved image for full-size preview
  • Organized Storage: Automatic categorization by detection type

3. Video Feed Controls

โ–ถ๏ธ Play    - Start/resume video feed
โธ๏ธ Pause   - Temporarily pause detection
โน๏ธ Stop    - Completely stop video feed and detection

4. Detection Monitoring

  • Status Indicators: Real-time visual feedback for each detection type
  • Alert System: Notifications for new detections
  • Statistics Dashboard: Comprehensive detection analytics
  • Historical Data: Track detection patterns over time

5. Image Saving & Gallery

  • Automatic Saving: Enable in "Member's Images" dialog
  • Categorized Storage: Images automatically sorted by detection type
  • Gallery Browser: Intuitive interface for viewing saved detections
  • Preview System: Click thumbnails for enlarged preview

๐Ÿ“‚ Detailed Project Architecture

P8GP_G01/
โ”‚
โ”œโ”€โ”€ ๐Ÿ—‚๏ธ venv/                          # Virtual environment (optional)
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE                        # ๐Ÿ”’ Non-commercial use license
โ”œโ”€โ”€ ๐Ÿ“„ .gitignore                     # ๐Ÿšซ Git exclusion rules
โ”œโ”€โ”€ ๐Ÿ“„ README.md                      # ๐Ÿ“š Main project documentation
โ”‚
โ”œโ”€โ”€ ๐Ÿ—‚๏ธ Project_Picture/               # ๐Ÿ“ธ Project Screenshots & Media
โ”‚   โ”œโ”€โ”€ amin1.png                    # Main application interface
โ”‚   โ””โ”€โ”€ [additional screenshots]     # Other project images
โ”‚
โ””โ”€โ”€ ๐Ÿ—‚๏ธ UI/                            # ๐Ÿ  Main Project Hub
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ Codes/                      # ๐Ÿง  Core Application Logic
    โ”‚   โ”œโ”€โ”€ __init__.py               # Package initialization
    โ”‚   โ”œโ”€โ”€ Application.py            # ๐Ÿš€ Entry point & app launcher
    โ”‚   โ”œโ”€โ”€ MainWindow.py             # ๐Ÿข Main application window
    โ”‚   โ”œโ”€โ”€ WelcomeScreen.py          # ๐Ÿ‘‹ Animated welcome interface
    โ”‚   โ”œโ”€โ”€ Dashboard.py              # ๐Ÿ“Š Central monitoring dashboard
    โ”‚   โ”œโ”€โ”€ VideoPlayer.py            # ๐Ÿ“น Video feed & playback controls
    โ”‚   โ”œโ”€โ”€ ControlPanel.py           # ๐ŸŽ›๏ธ Detection monitoring panel
    โ”‚   โ”œโ”€โ”€ Notification.py           # ๐Ÿ”” Alert & notification system
    โ”‚   โ”œโ”€โ”€ Dialogs.py                # ๐Ÿ’ฌ Dialog windows & modals
    โ”‚   โ”œโ”€โ”€ DetectionEngine.py        # ๐Ÿค– AI detection core logic
    โ”‚   โ”œโ”€โ”€ CameraManager.py          # ๐Ÿ“ท Camera handling & management
    โ”‚   โ””โ”€โ”€ Utilities.py              # ๐Ÿ› ๏ธ Helper functions & utilities
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ Imgs/                       # ๐ŸŽจ Visual Assets
    โ”‚   โ”œโ”€โ”€ P1.png                    # Welcome screen background
    โ”‚   โ””โ”€โ”€ icon.png                  # Application icon
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ Images/                     # ๐Ÿ’พ Detection Output Storage
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Masks/                 # Saved face mask detections
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Safety_hats/           # Saved helmet detections
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Smoking/               # Saved smoking detections
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Fire/                  # Saved fire detections
    โ”‚   โ”œโ”€โ”€ ๐Ÿ“ smoke/                 # Saved smoke detections
    โ”‚   โ””โ”€โ”€ ๐Ÿ“ Cigarettes/            # Saved cigarette detections
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“ Models/                     # ๐Ÿง  AI Model Repository
    โ”‚   โ”œโ”€โ”€ Mask_Detection.pt         # Face mask detection model
    โ”‚   โ”œโ”€โ”€ Smoking_Detection.pt      # Smoking activity model
    โ”‚   โ”œโ”€โ”€ Fire_Detection.pt         # Fire detection model
    โ”‚   โ””โ”€โ”€ Helmet_Detection.pt       # Safety helmet model
    โ”‚
    โ”œโ”€โ”€ ๐Ÿ“„ README.md                   # ๐Ÿ“š UI-specific documentation
    โ””โ”€โ”€ ๐Ÿ“„ requirements.txt            # ๐Ÿ“ฆ Python dependencies

๐Ÿ‘ฅ Development Team & Credits

๐ŸŽจ Lead Developer & UI Designer

Amin Moniry
Full-Stack Development, Programming & User Interface Design

Responsible for:
โ€ข Core application architecture
โ€ข AI model integration
โ€ข GUI design & implementation
โ€ข Cross-platform compatibility
โ€ข User experience optimization

๐ŸŽ“ Project Supervisor & Technical Advisor

Saeed Shokraneh
Academic Supervision & Technical Guidance

Responsible for:
โ€ข Project oversight & guidance
โ€ข Technical review & validation
โ€ข Academic supervision
โ€ข Quality assurance
โ€ข Strategic direction

โ„น๏ธ Project Information

Attribute Value
Version 2.1
Release Date April 25, 2025
Development Location Tabriz, Iran ๐Ÿ‡ฎ๐Ÿ‡ท
Project Type Open Source Safety Monitoring System
Primary Language Python
GUI Framework PyQt6
AI Framework YOLO (Ultralytics)

๐Ÿ“ Important Notes & Tips

๐Ÿ”ง Technical Considerations

  • Camera Connection: Ensure your webcam is properly connected and accessible before launching
  • Windows Users: Install pygrabber for enhanced DirectShow camera detection capabilities
  • Linux Users: Optional v4l2-ctl installation for advanced camera detection (generic detection available as fallback)
  • Raspberry Pi: Additional GPIO and hardware setup may be required for embedded deployment

โšก Performance Optimization

  • CPU Usage: Monitor system resources during detection operations
  • Memory Management: Close unused applications for optimal performance
  • Camera Resolution: Higher resolutions improve detection accuracy but increase processing load
  • Model Selection: Different models have varying computational requirements

๐Ÿ”’ Security & Privacy

  • Local Processing: All detection occurs locally - no data transmitted externally
  • Image Storage: Saved images remain on local device storage
  • Camera Access: Application requests camera permissions as needed

๐Ÿค Contributing to P8GP-G01

We welcome contributions from the community! Here's how you can help improve the project:

๐Ÿ“‹ Contribution Guidelines

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

๐Ÿ› Bug Reports

  • Use the GitHub Issues template
  • Include system information and error logs
  • Provide steps to reproduce the issue
  • Attach relevant screenshots if applicable

๐Ÿ’ก Feature Requests

  • Describe the proposed feature in detail
  • Explain the use case and benefits
  • Consider implementation complexity
  • Discuss potential impacts on existing functionality

๐Ÿ“ง Support & Contact

๐Ÿ“ž Get in Touch

For questions, support, or collaboration opportunities:

๐ŸŒ GitHub Repository: https://github.com/Amin-moniry-pr7

๐Ÿ“ง Email Support: Available through GitHub profile

๐Ÿ› Issue Tracker: Use GitHub Issues for bug reports and feature requests

๐Ÿ’ฌ Discussions: Join project discussions on GitHub


๐Ÿ™ Thank You

Thank you for choosing P8GP-G01 for your safety monitoring needs!

Built with โค๏ธ in Tabriz, Iran


Made with Python Powered by AI Open Source

About

๐Ÿง โœจ DetectSafeVisionX ๐ŸŽฏ AI-powered system for real-time detection of ๐Ÿฆบ helmets, ๐Ÿ˜ท face masks, ๐Ÿšฌ smoking, ๐Ÿ”ฅ fire, and ๐Ÿ’จ smoke ๐Ÿ” Smart. Fast. Reliable.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages