Inspiration

Workplace accidents caused by missing PPE are still a major problem on construction sites worldwide. I wanted to build something that could actually help prevent these accidents — not just detect them after the fact, but catch violations in real time before someone gets hurt.

What it does

SafeGuard Vision monitors workers on construction sites using AI. It detects whether workers are wearing helmets and safety vests, and immediately flags any violations. The system works in three modes: image analysis, video analysis, and a live monitoring panel designed for safety officers. Every violation is logged with a timestamp and automatically saved as a screenshot.

How I built it

The entire project was built with Python. I used OpenCV for image processing, Roboflow's specialized PPE detection model (96.9% mAP) via REST API for detection, Streamlit for the web dashboard, Plotly and Pandas for data visualization and logging, and Typer with Rich for the CLI interface.

Challenges I ran into

The biggest challenge was image loading — PIL and OpenCV handle formats differently, which caused errors early on. I solved this by reading images as byte arrays and decoding with cv2.imdecode. I also ran into Python 3.13 compatibility issues with some libraries and had to find alternative approaches. Finding the right pre-trained PPE model took time too — the general YOLOv8 model didn't recognize helmet or vest classes, so I switched to a specialized Roboflow model.

What I learned

I learned a lot about integrating REST APIs into real-time computer vision pipelines, building multi-mode dashboards with Streamlit, and handling cross-library image format issues. I also got a much better understanding of how AI-based safety systems can realistically be deployed in industrial environments.

What's next

The next step is full RTSP camera integration so the system can connect directly to existing IP security cameras on construction sites — no hardware changes needed. I also plan to add vest detection, multi-camera support, and email/SMS alerts for safety officers.

Built With

Share this project:

Updates

Submission history