Spaces:
Runtime error
Runtime error
Commit History
-
feat(scan): right-click scan-mode alerting + per-camera pose
Scan mode runs parallel low-fps inference sessions per CCTV with no HLS overhead, triggered via right-click on the FE map. Each session owns a RuleEngine that fires on sustained_count rules and persists alerts (JPEG snapshot + H.264 MP4 clip from a ring buffer) into the shared `alerts` table with source='cctv-scan'. Backbone: - ScanSessionWorker: capture -> infer -> rules -> ring buffer - RuleEngine: sustained_count with cold-start guard + per-rule cooldown + progress_snapshot() for the FE probability bar - FrameRingBuffer: deque + JPEG snapshot + H.264 MP4 encode via ffmpeg subprocess (cv2 mp4v fallback when ffmpeg absent) - AlertsDAO: INSERT/UPDATE/query against the Prisma-owned `alerts` table - ScanEventBus: thread-safe pub/sub bridging worker threads to async WS - Registry: second worker pool (MAX_SCAN_STREAMS) sharing the detector Pose pipeline: coverage polygon + per-detection geo projection now use heading_deg / fov_deg from cctv_streams when present (falls back to GEO_* e…d6b1333
-
feat(model): default to standard YOLOv8 backbone for CPU production
Local benchmark on M2 + ONNX Runtime CoreML, single-frame inference: YOLO-World M (worldv2, 180M params, vision + text branch) → 13.7 fps, 73 ms / frame YOLOv8 M (standard, 26M params, vision-only) → 56.6 fps, 18 ms / frame ───────── 4.1× speedup on the same hardware, same imgsz → projection on EPYC 4 cores: ~15-20 fps (was 0.6 fps with YOLO-World M, fundamentally too heavy) YOLO-World shines for zero-shot detection of arbitrary text-prompted classes, but the dual-branch vision-language fusion is a CPU non-starter: even with static-class export the text encoder branch keeps contributing residual compute every frame. Standard YOLOv8 with its fixed 80 COCO classes covers everything traffic monitoring needs (car / truck / bus / motorcycle / bicycle / person), so unless the fleet specifically demands the YOLO-World classes (becak / bemo / bajaj / angkot / ojek as distinct labels), the speed is the better trade.…5b1b3f2 -
ci(deploy): build + ship cakra-yolo to the cakra-network VM
Mirrors the location-propability pipeline: build the image, push to GHCR, SSH into the production VM, replace the running container via straight `docker run`. No compose file — the box only needs one container per service so the extra layer earns nothing here. Pipeline: 1. `docker/build-push-action` builds with cache scoped to gha, bakes YOLO-World M weights + ONNX export at build time (via the Dockerfile's YOLO_BUILD_SIZE and YOLO_EXPORT_IMGSZ ARGs). 2. `appleboy/ssh-action` pulls the image on the VM, writes the YOLO_ENV_FILE secret to /opt/cakra/yolo/.env, then replaces the container. 3. Container joins the external `cakra-network` overlay shared with the platform's NestJS api and React web, so the API reaches this service at http://cakra-yolo:7860 with no public port exposed. 4. `--cpus 4` caps inference at 4 cores on an 8-core EPYC, leaving headroom for the API + ffmpeg encoders sharing the box. 5. Healthcheck via `docker exec` (no host…725b40f