Video Alerts: Plain-English Rules for Cameras by Syed MustafaVideo Alerts: Plain-English Rules for Cameras by Syed Mustafa

Video Alerts: Plain-English Rules for Cameras

Portfolio project
Syed Mustafa
A smart camera alert system where you describe what to watch for in plain English, like "somebody has fallen" or "someone is sweeping the floor", and get an alert on a dashboard (plus an optional webhook) when the camera shows it. No training data or custom model per rule is needed.
How it decides: every second a frame is sampled from the RTSP stream, and every 4 seconds the last 8 frames are embedded as one video clip with Google's EmbeddingGemma 2. The rule sentence is embedded into the same space. The score is compared with that camera's own recent history and with about 35 everyday scene descriptions, so a rule only fires when the clip really stands out. An alert needs 2 of the last 3 windows to agree, and each rule has a cooldown. Marking an alert as a false alarm teaches the rule to ignore similar clips.
Second check: every flagged window is double-checked by the Qwen3-VL-4B vision model, which answers yes or no to the rule from the window's 8 frames. It only runs on candidates (about 3% of window-rule pairs), at around 0.2 seconds each, which removes false alarms while keeping the system cheap.
Also supports uploading a video file with several rules and analysing it as fast as the GPU allows. Stack: Python, PyTorch with CUDA, EmbeddingGemma 2, Qwen3-VL, FastAPI, web dashboard.

0 likes · 0 views · Nov 24, 2026

Write a rule in plain English for an RTSP camera and get an alert when it happens, using EmbeddingGemma 2 and Qwen3-VL.

Tags