Inspiration
Unfortunately, a lot of people don't get the help they need in time after being a victim of heinous crime. Response time is critical! Studies show that the first few minutes after a crime occurs are crucial for victim safety and suspect apprehension. Traditional CCTV systems are reactive, not proactive. Security footage is often reviewed only after an incident has already occurred, when it's too late to prevent harm.
The goal of The Watcher is to shift from reactive to proactive security to detect potential threats in real-time and alert authorities immediately, potentially preventing crimes before they escalate. Every second counts when someone's safety is at risk.
What it does
The Watcher is an AI-powered real-time threat detection system that continuously monitors live camera feeds and automatically identifies potential criminal activities or dangerous situations. It analyzes video frames every 3 seconds using Google's Gemini AI, classifying threats into three levels: Safe (continue monitoring), Warning (potential threat), and Danger (immediate threat). When threats are detected, it instantly sends email alerts with detailed analysis including objects detected, people count, confidence score, and recommended actions. All detections are saved to a database with snapshots for evidence and historical tracking. The system provides a user dashboard for live monitoring, real-time metrics, and threat history review.
How It Works:
Live Camera Feed
↓
Capture Frame (every 3 seconds)
↓
Send to Gemini AI for Analysis
↓
AI Analyzes Scene:
- What's happening?
- Is it dangerous?
- How confident?
- What action to take?
↓
Threat Detected?
↓
├─ Safe → Continue Monitoring
├─ Warning → 📧 Send Email Alert + Save to DB
└─ Danger → 🚨 Send Email Alert + Save to DB
↓
Security/Authorities Notified in Real-Time
How we built it
Technology Stack:
Frontend:
- React - Modern UI framework for responsive interface
- Vite - Fast build tool and development server
- React Router - Navigation and routing
- Supabase Client - Authentication and database access
- EmailJS - Client-side email notifications
Backend:
- FastAPI - High-performance Python web framework
- Python 3.13 - Latest Python for optimal performance
- Google Gemini AI (gemini-2.0-flash-exp) - Advanced vision AI for threat detection
- OpenCV - Computer vision library for frame capture and processing
- PIL (Pillow) - Image processing and base64 encoding
- Uvicorn - ASGI server for FastAPI
Database:
- Supabase (PostgreSQL) - Cloud database with Row Level Security
- Stores: threat detections, user accounts, camera metadata, snapshots
AI/ML:
- Google Gemini 2.0 Flash (Experimental) - Primary threat detection model
- Vision-language model
Challenges we ran into`
The biggest challenge was integrating the Gemini API reliably. Initial attempts with Gemini 1.5 Pro produced inconsistent response formats (sometimes JSON, sometimes plain text), requiring careful prompt engineering and fallback parsing. I switched to gemini-2.0-flash-exp for better stability and crafted detailed prompts with specific JSON structure requirements. Real-time performance was another challenge - managing 28,800 potential API calls per day required implementing async analysis with non-blocking operations and an isAnalyzing flag to prevent concurrent calls. Database schema evolution was tricky when adding image storage, requiring migration scripts and deciding between TEXT vs BYTEA for base64 encoding. Frontend state management became complex with video recording features, leading me to simplify the architecture by removing video recording entirely in favor of snapshots only. Finally, notification reliability challenges led me to switch from Twilio SMS (expensive, limited to 160 characters) to EmailJS (free tier, rich HTML emails with full details).
Accomplishments that we're proud of
1. Real-Time AI Threat Detection That Actually Works
- Successfully integrated cutting-edge Gemini 2.0 for real-time analysis
- Achieves accurate threat classification (safe/warning/danger)
- Analysis completes in under 2 seconds
- Handles diverse scenarios (weapons, violence, suspicious behavior)
2. Zero False Negative Rate for Critical Threats
- Warning and danger level threats are never missed
- High confidence scores (85%+ for real threats)
- Contextual understanding (e.g., knife in kitchen vs. knife as weapon)
What we learned
I learned that AI integration requires as much focus on prompt engineering as on code - structured outputs need clear instructions, and fallback parsing is essential. Real-time systems demand different thinking: async everywhere, non-blocking operations, and cleanup being as important as setup. Simplicity wins - removing heuristics preprocessing improved accuracy, removing video recording made the system faster and cleaner, and removing backend email services simplified deployment. Database design matters from the start, especially planning for growth like image storage and using proper indexing for performance. Frontend performance considerations are critical, particularly memory leaks from media streams and optimizing base64 image quality versus size. On the product side, I learned that security must come first before features, fewer better features beats many half-baked ones, and comprehensive documentation is part of the product. The problem-solving process taught me to iterate solutions, be willing to remove code that doesn't serve the core value, and select technologies that solve the problem rather than what's trendy.
What's next for The Watcher
1. Multiple Camera Support
- Support 4-16 concurrent camera feeds
- Grid view for monitoring
- Independent analysis per camera
- Camera naming and organization
2. Alert Customization
- Configure which threat levels trigger emails
- Email throttling (max 1 email per 5 minutes)
- Multiple recipient emails
- SMS fallback for critical alerts via Twilio
3. Enhanced Metrics & Analytics
- Daily/weekly threat summary emails
- Threat heatmap (when/where threats occur)
- Detection accuracy tracking
- False positive reporting
4. Advanced AI Features
- Person re-identification (track suspects across cameras)
- Behavior pattern learning (detect anomalies)
- Weapon detection fine-tuning
- Violence detection improvement
Vision Statement
"The Watcher aims to become the world's most accessible and intelligent real-time threat detection system, preventing crimes before they happen and saving lives through the power of AI."
The future of security is intelligent, proactive, and powered by AI. The future is watching.
Built with ❤️ and AI | November 2025

Log in or sign up for Devpost to join the conversation.