🚨 Video Red Flag Analyzer
We built Video Red Flag Analyzer during a 24-hour hackathon with the aim of providing first responders, safety officers, and journalists with a fast, AI-driven way to analyze raw video footage for potential hazards or criminal activity.
In crowded or chaotic scenes, human eyes might miss subtle but dangerous cues. Our tool takes uploaded video footage and runs it through YOLOv8 for object detection, highlighting people, vehicles, weapons, and other important objects. The video is then passed to Google Gemini Pro, which generates a structured report with:
- Detailed incident descriptions
- Timestamps
- Severity levels (Low, Medium, High)
We visualize this data using a dual-plot timeline and bar graph, helping users immediately identify when and where high-risk events occur.
Finally, using Gemini-generated queries, we tap into the Serper API to fetch relevant safety tips and prevention strategies based on the red flags. The app compiles all this into a user-friendly interface with:
- A red-flag overview dashboard
- Safety tip expanders
- A downloadable incident report
What makes this unique is the end-to-end flow:
Video → YOLO Annotation → Gemini Scene Analysis → Structured Timeline → Safety Advice
All without requiring any paid API, keeping the solution free and accessible for anyone needing fast insights from video data.
🔧 Built With
- Streamlit – Frontend framework for interactive user interface
- Google Gemini 1.5 Pro API – For scene understanding, red flag description, and safety tip generation
- YOLOv8 (Ultralytics) – For real-time object detection and video annotation
- OpenCV – For frame-by-frame video processing and writing annotated outputs
- Matplotlib – For generating visual timelines and severity graphs
- Python – Core programming language for backend logic
- dotenv – For secure environment variable management
- Serper API – For real-time search-based safety recommendations
- Base64 + MIME Utilities – For secure video data handling and formatting for LLM input
Log in or sign up for Devpost to join the conversation.