dinil balasuriya/ projects / siteguard

3rd, lovable hackathon23 may 2026

siteguard

3rd at the lovable hackathon. a yolo model i fine-tuned on construction data to spot missing hard hats and hi-vis on a live camera feed.

private repo, no public link

clipcam 01

two workers from behind: hat and vest, green. no hard hat, red

compliant hard hat and hi-visnon-compliant something missing

pitching siteguard at the lovable hackathon, 23 may
pitching siteguard at the lovable hackathon, 23 may
01 / story
  • eventlovable hackathon
  • when23 may 2026
  • built in24 hours

a site manager cannot watch every gate, and a missing hard hat is easy to miss.

siteguard is a yolo model i fine-tuned on construction data to spot missing hard hats and hi-vis on a live camera feed. every person gets a box: green when they're wearing both, red when something is missing.

the model is 24 mb and took about 4 hours of training on my macbook. this could probably run on your microwave.

we built it in 24 hours at the lovable hackathon, co-hosted with january capital, on 22 to 23 may 2026, and came 3rd.

i worked across the computer vision, backend, product direction and pitch.

the fiddly part was matching: deciding when a hat detection belongs to a person's head, and keeping the boxes lined up with the live video.

the follow-up was a landing page for it, called sentvel, a month later.

this could probably run on your microwave.

24 mb, about 4 hours of training on my macbook

02 / the demo clips
siteguard, live viewcompliant hard hat and hi-visnon-compliant something missing
03 / on the day
04 / how it works
  • two yolo detectors run on every frame: a general yolov8 model finds people, and a second model finds hard hats and hi-vis. that second one is the 24 mb model i fine-tuned on construction data, starting from a pretrained ppe detector. the fine-tuned weights aren't in the repo yet.
  • a rule joins them: a helmet counts only if its centre falls in a narrow strip over the top quarter of a person's box. no match means "no hard hat" (backend/app/compliance.py).
  • Python FastAPI backend with a /infer endpoint taking a base64 frame and returning boxes, per-person verdicts and inference time in ms; models load lazily and run on Apple's GPU (MPS) or CPU.
  • Next.js, TypeScript and Tailwind frontend: react-webcam grabs a frame, posts it, and a canvas laid over the video redraws green and red boxes from the reply; it sends the next frame as soon as the last reply lands and never overlaps requests, and shows "backend offline" instead of crashing.
  • 6 commits over 20 to 22 May 2026, about 830 lines across the two apps, 3 unit tests on the hat-to-person rule.
05 / numbers
  • 3rd place
  • 22to 23 May 2026 event dates
  • 24 hoursto build
  • 24 mbmodel, YOLO CNN, fine-tuned on construction data
  • about 4 hoursof training on my macbook
  • 6commits, 20 to 22 May 2026
  • 827lines of code in backend app, tests and the main page
  • 3unit tests
  • 4demo clips, 5.8 to 16.9 s each, shot 23 May 2026