
Osgilai
User friendly deployable AI: Local inference, guided onboarding, remote training
Overview
Osgilai
User friendly deployable AI: Local inference, guided onboarding, remote training
An edge-AI product stack for SKU-specific detection, tracking, and counting. Three layers: a Raspberry Pi edge runtime (capture, inference, counting, analytics sync), a customer app (device claim, zone setup, guided SKU enrollment), and a FastAPI training server (frame ingest, automatic training, signed artifact delivery).
The hard part wasn't running YOLO on a Pi — it was deploying a system a non-technical user could drive end to end.
From basement prototype to deployable edge runtime
First prototype: capture, tracking, training, and counting running on my mac with a webcam instead of in a mock dashboard. Training on my mac was frying my SSD by spilling into swap for larger datasets or running larger batch sizes, so I finally pivoted to a dedicated training server on a remote PC that had the memory capacity for quick trains.
SKU onboarding and guided customer workflow
The control app ran as a guided state machine: name SKU → describe object → pick runtime target → choose camera → start capture. The same surface handled device discovery, claim, preview, model selection, and deployment activation, so onboarding and field provisioning sat in one place.
Capture pipeline and training handoff
Data collection ran as recording sessions with planned snippets, countdown prompts. On finalize, the session handed off to a FastAPI training service via a five-step contract (create session, upload frames by snippet, finalize, enqueue training, poll for the artifact), carrying seed/approval/expansion targets, detector thresholds, autolabel config, runtime target, and labeler model IDs.
Remote autolabel and training server
Training ran on a remote PC with a 3090, fronted by FastAPI behind a Cloudflare Tunnel and kept alive as a Windows service via NSSM. The autolabel stage used Grounding DINO to seed boxes from text prompts, then SAM2 to refine masks; an approval pass filtered seed quality before an expansion pass grew the labeled set to the target count. The expanded set trained the runtime detector, with the final artifact (weights + metadata) returned to the caller for deployment.
Tracked-object counting on a short training cycle
Tracking and counting on a tennis ball after one five-minute automated training round. Full contract in motion: train on server → signed artifact to Pi → backend prep on device → tracked detections per frame → live zone counter decides whether an event counts.
Dedicated edge hardware, diagnostics, offline sync
Dedicated hardware: Raspberry Pi 5 + Hailo accelerator + camera in a 3D-printed enclosure. Edge-to-cloud contract stayed narrow — fetch assigned config and signed model URL, upload queued event batches. A SQLite spool kept counting independent of the network.
A deployable edge-AI stack: inference, retraining, signed artifact delivery, offline analytics.