Skip to content
LWCase studyComputer Vision · Civic TechDelivered

Litter Watch — Street Garbage Detection

Finds street garbage from a moving scooter and pins every pile to a real coordinate a municipality can act on.

A computer-vision system that finds garbage piles in street video shot from a moving scooter, pins each one to a real coordinate, and streams annotated frames to a live dashboard — with a geometry gate that filters out people, vehicles and street furniture.

Litter Watch — Street Garbage Detection interface
Industry
Civic / Municipal
Role
ML & Full-Stack Engineer
Type
AI System
Year
2025

01

Overview

Litter Watch detects garbage and trash piles in street footage filmed from a phone mounted on a moving scooter — the cheapest possible survey rig for an Indian city. A YOLO detector runs over sampled frames, and every confirmed pile is pinned to its own coordinate so the output is a map of where the problem actually is, not just a count.

The hard part is not detection but suppression. Street scenes are full of things that look like a trash pile to a naive detector: people crouching, parked vehicles, stones, tree litter, benches, posters and fences. A geometry gate filters these forbidden classes explicitly and reports how many boxes it rejected, so the confirmed count means something.

The same detector drives two faces — a FastAPI backend streaming an MJPEG feed to a Next.js dashboard with a live map and per-locality stats, and a CLI that batch-processes a video into an annotated file plus a JSON report.

02

Business challenge

Municipal garbage surveys are done on foot with clipboards — slow, expensive and stale by the time they are compiled. There was no cheap way to answer "where exactly is the garbage" across a city, and a naive detector run over street video reports every crouching person and parked vehicle as a pile.

03

Solution

A detection pipeline driven by phone video from a moving scooter: sampled frames run through a YOLO model trained on trash piles, a geometry gate rejects forbidden classes, and every surviving detection is pinned to a coordinate and streamed to a live dashboard.

What it does

YOLO detector trained for street-level garbage piles
Geometry gate that filters people, vehicles and street furniture
Live MJPEG feed of annotated frames in the browser
Every pile pinned to its own map coordinate
Per-locality breakdown of where garbage was found
Confidence and frame-interval controls at runtime
Video upload from the dashboard with progress
Webcam and IP-camera sources alongside video files
CLI batch mode producing an annotated video plus a JSON report
Downloadable annotated video after a run

04

Product screenshots

Screens from the application itself. Select any image to view it full size.

05

Architecture

How it fits together

  1. 01YOLOv8 detector with custom trash-pile weights, run through Ultralytics and OpenCV
  2. 02FastAPI backend exposing detection control, run statistics and an MJPEG frame stream
  3. 03Next.js dashboard with live feed, Leaflet coverage map, detection gallery and per-zone stats
  4. 04Geometry gate that filters forbidden classes and reports the rejection count for transparency
  5. 05Sandboxed video library — the detector resolves every job inside one folder and rejects escaping paths
  6. 06CLI batch path sharing the same detector, emitting an annotated video plus a JSON report

06

Engineering challenges

Challenge
The detector confidently boxed people, scooters, stones and posters as garbage — a false-positive rate that made the pile count meaningless.
How it was solved
Added an explicit geometry gate for forbidden classes and surfaced the rejected-box count in the UI, so suppression is visible rather than hidden. Green boxes show what was filtered; only red boxes are ever reported as garbage.
Challenge
Footage from a moving scooter means the same pile appears across many consecutive frames and would be counted repeatedly.
How it was solved
Sampled at a configurable frame interval and pinned confirmed detections to coordinates, so a pile resolves to one location rather than one count per frame it appears in.

07

Technology stack

Frontend
Next.jsReact
Backend
PythonFastAPI
AI & Processing
YOLOv8OpenCV
Also used
UltralyticsLeafletMJPEG streaming

08

Business impact

78%+
Avg Confidence
Live video
Detection
Geo-pinned piles
Output

A survey that previously needed people walking with clipboards became a scooter ride: in a single run the system processed street footage live, confirmed piles at 78%+ average confidence, filtered the forbidden-class boxes, and dropped every confirmed pile onto a Ranchi coverage map with a per-locality breakdown.

09

Project status

Delivered2025

What I took from it

  • On a real-world detector, the filtering rules carry more product value than the model — and showing what was rejected is what makes the remaining count trustworthy.
  • Constraining file jobs to a single sandboxed folder is worth doing on day one when the input is user-uploaded video.

Next step

Need a similar solution for your business?

Tell me what you are trying to build or fix. I will come back with how I would approach it, what it realistically takes and where the risks are.

Related work

All projects