Computer Vision Python

VectorGaze

Natural language safety queries on live video, zero training data required.

CLIPZero-ShotLanceDBEdge AI
Video FrameCLIP EmbedLanceDB SearchAlertNL QueryZero-Shot · Apple Silicon · Moondream2
System architecture

01 Background

Workplace safety monitoring traditionally requires expensive labeled video datasets to train a custom detector for each violation type. If a new hazard emerges (a new machine, a new PPE requirement), you're back to data collection. VectorGaze eliminates this bottleneck by using CLIP's zero-shot visual-language alignment: instead of training a detector, you describe the violation in natural language, and CLIP finds frames that semantically match. This makes the system instantly configurable for any safety scenario without a single labeled example.

02 How It Works

01

Video Sampling

Frames are sampled from the live or recorded video stream at configurable intervals (e.g., 1 frame per second for real-time, denser for analysis).

02

CLIP Visual Embedding

Each frame is encoded by CLIP's vision encoder into a 512-dimensional embedding that captures the visual semantics of the scene.

03

Query Embedding & Vector Search

The natural language safety query (e.g., "worker not wearing hard hat") is encoded by CLIP's text encoder. LanceDB performs approximate nearest-neighbor search across all frame embeddings.

04

Moondream2 Confirmation

Top candidate frames are passed to Moondream2 VLM for detailed visual reasoning, reducing false positives before alerting.

05

Edge Deployment

Entire pipeline runs on Apple Silicon (M-series) with Metal acceleration, no cloud calls, keeping footage private and latency sub-second.

03 Results & Impact

Zero-shot detection of arbitrary safety violations with no labeled training data

LanceDB enables real-time vector search across thousands of frame embeddings

Moondream2 reasoning step reduces false positive rate significantly

Fully on-device on Apple Silicon, so no data leaves the local network