Motivation
Industrial sites need continuous safety monitoring, but hazardous events (missing PPE, unsafe proximity) are rare in real footage — which starves any model of training data. The project had two halves: a real-time analysis pipeline to watch live video, and a generative pipeline to synthesize realistic edge-case imagery so the system could learn what danger looks like.
Architecture
A Vision-Language Model interprets video frames against safety prompts in real time, while a separate FLUX-based generator produces synthetic training data for rare scenarios. Everything is observable through a Streamlit interface and a structured logging framework.
📹Live VideoOpenCV capture
→
🧵Multi-thread Framesparallel decode
→
👁️Qwen VLMscene reasoning
→
🚨Safety Verdict+ logging
Real-time path. A parallel FLUX generator feeds synthetic edge cases back into training.
What I built
- End-to-end Gen-AI for industrial safety — both image generation and real-time video analysis pipelines.
- A customizable image generator on HuggingFace's FLUX model with both GUI and headless (non-GUI) modes.
- A logging framework capturing prompt and configuration data for full traceability and reproducibility.
- Multi-threaded video analysis with Qwen VLM, OpenCV and Streamlit for real-time monitoring.
Results
Real-timeLive video analysis
2 modesGUI + headless generator
Full tracePrompt & config logging
Challenges
- Latency vs. accuracy: VLM inference is heavy; multi-threading the frame pipeline kept analysis real-time without dropping critical frames.
- Data scarcity: real hazards are rare, so FLUX-generated synthetic scenarios filled the gap with controllable, labeled edge cases.
- Reproducibility: generative output is sensitive to prompts/config — the logging framework made every result traceable.
Learnings
- Synthetic data is a force multiplier when real edge cases are scarce or dangerous to capture.
- VLMs unlock open-vocabulary monitoring — you describe hazards in language instead of training a fixed-class detector.
- For real-time CV, the systems engineering (threading, I/O) matters as much as the model.