An AI-Powered Workplace Safety Monitoring System using Python, OpenCV, YOLOv8 and Tkinter Dashboard
Smart Safety Monitor is a modular Computer Vision application designed to improve workplace safety through real-time AI-powered surveillance.
The system continuously monitors live camera feeds and detects workplace safety violations using multiple YOLOv8 models.
It supports:
- ๐ค Person Detection
- ๐ฑ Mobile Phone Detection
- ๐ช Helmet Detection
- ๐ซ No Helmet Detection
- ๐ฆบ Safety Vest Detection
- ๐ซ Weapon Detection
Whenever a violation occurs, the application automatically:
- ๐ธ Captures screenshots
- ๐ Logs events into CSV
- ๐ Updates Dashboard Analytics
- โก Prevents duplicate alerts
- ๐ Displays live monitoring statistics
The project follows a modular software architecture, making it easy to extend with additional AI models such as Fire Detection, Intrusion Detection, PPE Compliance, and RTSP Camera Monitoring.
- Real-Time Person Detection
- Mobile Phone Detection
- Helmet Detection
- No Helmet Detection
- Safety Vest Detection
- Weapon Detection
- Triple YOLOv8 Model Architecture
- Live Webcam Monitoring
- Professional Status Panel
- Live Person Counter
- Live Mobile Counter
- Live Helmet Counter
- Live No Helmet Counter
- Live Safety Vest Counter
- Live Weapon Counter
- Live FPS Counter
- Live Date & Time
- Mobile Violation Detection
- No Helmet Violation Detection
- Weapon Violation Detection
- Frame-Based Event Confirmation
- Duplicate Event Prevention
- Modular Violation Manager
- Automatic Screenshot Capture
- Timestamped Image Saving
- Organized Screenshot Folder
- Event-wise Screenshot Naming
- CSV Event Logging
- Event Timestamp
- Person Count
- Mobile Count
- Helmet Count
- No Helmet Count
- Vest Count
- Weapon Count
- Screenshot Name
- Tkinter Dashboard
- Live Statistics
- Latest Event Viewer
- Latest Screenshot Viewer
- Dashboard Auto Refresh
- Event Analytics
- CSV-based Monitoring
- Modular Python Project
- Object-Oriented Design
- Multiple AI Model Support
- Event Manager
- Violation Manager
- Screenshot Manager
- Logger Module
- Reusable Drawing Module
- Clean Code Structure
Smart_Safety_Monitor/
โ
โโโ dashboard/
โ โโโ __init__.py
โ โโโ analytics.py
โ โโโ dashboard.py
โ
โโโ docs/
โ โโโ images/
โ
โโโ logs/
โ
โโโ models/
โ โโโ coco/
โ โโโ ppe/
โ โโโ weapon/
โ
โโโ output/
โโโ screenshots/
โโโ videos/
โ
โโโ utils/
โ โโโ camera.py
โ โโโ constants.py
โ โโโ date_time.py
โ โโโ detector.py
โ โโโ drawing.py
โ โโโ event_manager.py
โ โโโ fps.py
โ โโโ logger.py
โ โโโ mobile_detector.py
โ โโโ ppe_detector.py
โ โโโ screenshot.py
โ โโโ violation_manager.py
โ โโโ weapon_detector.py
โ
โโโ main.py
โโโ test_ppe_model.py
โโโ test_ppe_video.py
โโโ test_weapon_model.py
โโโ requirements.txt
โโโ README.md
โโโ .gitignore
- Python 3.10
- OpenCV
- YOLOv8 (Ultralytics)
- PyTorch
- Tkinter
- Pandas
- NumPy
- OpenCV Drawing API
- CSV
- Git
- GitHub
git clone https://github.com/vikas-tikapur/Smart_Safety_Monitor.git
cd Smart_Safety_Monitorpy -3.10 -m venv venv.\venv\Scripts\Activate.ps1venv\Scripts\activatepip install -r requirements.txtpython main.pypython -m dashboard.dashboardpython test_ppe_model.pypython test_ppe_video.pypython test_weapon_model.pyThe project uses multiple YOLOv8 models for different detection tasks.
| Model | Purpose | Status |
|---|---|---|
| YOLOv8 COCO | Person Detection | โ |
| YOLOv8 COCO | Mobile Phone Detection | โ |
| PPE YOLOv8 | Helmet Detection | โ |
| PPE YOLOv8 | No Helmet Detection | โ |
| PPE YOLOv8 | Safety Vest Detection | โ |
| Weapon YOLOv8 | Weapon Detection | โ |
Live Camera
โ
โผ
Frame Capture
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
YOLOv8 COCO Detector
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโ Person Detection
โโโ Mobile Detection
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PPE YOLOv8 Detector
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโ Helmet
โโโ No Helmet
โโโ Safety Vest
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weapon YOLOv8 Detector
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโ Weapon Detection
โ
โผ
Violation Manager
โ
โผ
Event Manager
โ
โโโ Screenshot Manager
โโโ CSV Logger
โโโ Dashboard
| Module | Status |
|---|---|
| Project Architecture | โ |
| Modular Design | โ |
| Camera Module | โ |
| YOLOv8 COCO Detection | โ |
| Person Detection | โ |
| Mobile Detection | โ |
| PPE Detection | โ |
| Helmet Detection | โ |
| No Helmet Detection | โ |
| Safety Vest Detection | โ |
| Weapon Detection | โ |
| Drawing Module | โ |
| Screenshot Manager | โ |
| CSV Event Logging | โ |
| Event Manager | โ |
| Violation Manager | โ |
| Dashboard | โ |
| Dashboard Analytics | โ |
| Live Counters | โ |
| Auto Refresh | โ |
| Documentation | โ |
| Component | Progress |
|---|---|
| Core Architecture | 100% |
| AI Detection | 100% |
| Dashboard | 100% |
| Event Management | 100% |
| Violation Management | 100% |
| Documentation | 100% |
| Code Cleanup | 100% |
The remaining work consists of optional enterprise-level features such as:
- RTSP Camera Support
- Email Alerts
- Audio Alarm
- Multi-Camera Monitoring
- AI Reports
These features are planned for future releases and are not required for Version 1.0.
- Triple YOLOv8 Model Architecture
- Person Detection
- Mobile Detection
- PPE Detection
- Weapon Detection
- Live Monitoring Dashboard
- Screenshot Capture
- CSV Logging
- Event Manager
- Violation Manager
- Professional Monitoring Panel
- Live Statistics
- Code Cleanup
- Documentation
Live Camera
โ
โผ
Video Frame Capture
โ
โโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ YOLOv8 COCO โ โ PPE YOLOv8 โ โ Weapon YOLOv8 โ
โ โ โ โ โ โ
โ โข Person โ โ โข Helmet โ โ โข Weapon โ
โ โข Mobile โ โ โข No Helmet โ โ โ
โ โ โ โข Safety Vest โ โ โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโดโโโโโโโโโโโโโโโโฌโโโโโโโโโ
โผ
Detection Aggregation
โ
โผ
Violation Manager
โ
โผ
Event Manager
โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโ
โผ โผ โผ
Screenshot CSV Event Logger Live Dashboard
Manager โ
โผ
Dashboard Analytics
The primary objective of this project is to build a modular AI-powered workplace safety monitoring system capable of detecting safety violations in real time.
Current goals achieved:
- โ Real-time workplace monitoring
- โ Multi-model AI detection
- โ Modular architecture
- โ Event-based violation management
- โ Automated screenshot capture
- โ CSV event logging
- โ Live monitoring dashboard
- โ Professional code structure
- โ Extensible architecture
- RTSP/IP Camera Support
- Video File Processing
- Email Alerts
- Audio Alarm
- Dashboard Charts
- Daily Reports
- Better Dashboard UI
- Multi-Camera Monitoring
- Face Recognition
- Attendance System Integration
- Fire Detection
- Smoke Detection
- Restricted Area Detection
- Cloud Dashboard
- Web Application
- User Authentication
- AI Safety Reports
- Database Integration
- REST API
- Docker Deployment
- Edge AI Deployment
This project demonstrates practical experience in:
- Python Development
- Computer Vision
- Deep Learning
- YOLOv8
- OpenCV
- Object-Oriented Programming
- Modular Software Architecture
- Event-Driven Programming
- Dashboard Development
- Real-Time Video Processing
- AI-Based Workplace Safety Monitoring
This project is designed to simulate a real-world industrial safety monitoring solution.
It combines multiple AI models into a single modular application capable of monitoring workplace safety in real time while generating evidence, logs, and analytics.
The architecture is scalable and can easily be extended with additional AI models, making it suitable for future enterprise-level surveillance applications.
AI / ML Developer | Python Developer | Computer Vision Enthusiast
- GitHub: https://github.com/vikas-tikapur
- Portfolio: https://vikas-tikapur.github.io/portfolio-website/index.html
This project is intended for educational purposes and portfolio demonstration.
You are free to fork, learn from, and improve this project while giving appropriate credit.
Contributions are always welcome!
If you have ideas for improving this project:
- Fork the repository
- Create a new feature branch
git checkout -b feature-name- Commit your changes
git commit -m "Add new feature"- Push to your branch
git push origin feature-name- Open a Pull Request
- Windows 11
- Python 3.10
- OpenCV
- Ultralytics YOLOv8
- PyTorch
- Tkinter
- Python
- YOLOv8 COCO
- YOLOv8 PPE
- YOLOv8 Weapon
- Person Detection
- Mobile Detection
- Helmet Detection
- No Helmet Detection
- Safety Vest Detection
- Weapon Detection
- Screenshot Manager
- CSV Logger
- Event Manager
- Violation Manager
- Live Monitoring
- Analytics
- Latest Events
- Latest Screenshot
- Auto Refresh
This project helped in learning:
- Object-Oriented Programming
- Modular Software Development
- OpenCV
- YOLOv8 Integration
- Multiple AI Model Integration
- Event-Driven Programming
- CSV Logging
- Dashboard Development
- Real-Time Computer Vision
- Software Architecture Design
- Git & GitHub Workflow
- Debugging and Testing
- RTSP Camera Support
- Multi-Camera Monitoring
- Email Notifications
- Telegram Alerts
- Audio Alarm
- Fire Detection
- Smoke Detection
- PPE Compliance Reports
- Cloud Dashboard
- REST API
- Docker Deployment
- Database Integration
- User Authentication
โ Triple YOLOv8 Model Architecture
โ Real-Time Workplace Monitoring
โ AI-Based Safety Violation Detection
โ Modular Python Architecture
โ Automated Screenshot Capture
โ Event Logging
โ Dashboard Analytics
โ Professional Monitoring Panel
โ Live Statistics
โ Production-Ready Project Structure
Special thanks to the open-source community and the developers behind:
- Ultralytics YOLOv8
- OpenCV
- PyTorch
- Pandas
- NumPy
These libraries made it possible to build a real-time AI-powered workplace safety monitoring application.
If you found this project useful:
โญ Star this repository
๐ด Fork this repository
๐ก Share your suggestions
๐ค Contribute to future improvements
Release Candidate (RC)
Current Features:
- โ Person Detection
- โ Mobile Detection
- โ Helmet Detection
- โ No Helmet Detection
- โ Safety Vest Detection
- โ Weapon Detection
- โ Screenshot Capture
- โ CSV Logging
- โ Dashboard Analytics
- โ Event Manager
- โ Violation Manager
- โ Live Monitoring UI
Smart Safety Monitor is a modular AI-powered workplace surveillance system developed to demonstrate real-world applications of Computer Vision, Deep Learning, and Software Engineering.
The project focuses on building a scalable, maintainable, and production-oriented architecture that can be extended with future AI modules and enterprise-grade monitoring capabilities.




