Camera AI
A small box next to a hotspot camera runs YOLOv8 at 1–2 frames a second. It looks for one thing: an animal lying in a traffic lane and not moving, which is likely hurt or hit, and an accident waiting to happen. Healthy animals standing, eating or walking are ignored. Cameras are optional: citizen reports work from day one.
- 1Detect + track
YOLOv8n finds cows and dogs; ByteTrack follows each one across frames.
~35 ms / frame on a 4-core CPU - 2Lane check
Is the animal's position inside this camera's lane polygon?
- 3Lying + not moving
Body low and wide, or it went down from standing, and hardly moved for 30 s.
- 4One event
Snapshot + facts posted to the Agent Room, once per animal.
REST agent protocol - 5AI checks, rules decide
The Triage agent reads the snapshot. Hurt → URGENT: rescue NGO, vet, police to guard the spot, signboards on. Healthy and resting → only logged.
Latest camera cases
from the edge agentSignboards for drivers
no app neededFeed for the city's display boards: /api/signboards (JSON). A board warns while a case is open within 500 m of it.
What we measured
honest numbersLimits today: pretrained model only (it sometimes calls a dog a cow; the server's AI re-reads every snapshot); not yet tested on real footage of an animal lying in traffic or at night. The sample cameras are placeholders until the Ranchi Smart City ICCC partnership.
Run it on an edge box
pip install -r edge/requirements-edge.txt
python edge/camera_agent.py --video rtsp://camera-url --camera ratu-rd-01 \
--server https://your-straywatch --key $SW_AGENT_KEY --fps 2 --dwell 60 --still 30