← All posts

Looking back, written a few days after the hackathon.

ReThink Recycling: live trash detection without a GPU

At the Siemens × AWS hackathon in Berlin I built real-time trash detection, and our team took first place.

First place at the Siemens × AWS hackathon “ReThink Recycling”. Four days at the Werner-von-Siemens Centre in Berlin, around 60 students, topic: recycling with AI. Our team was about seven people.

We wanted something you can see working. So: a camera that detects and segments trash in real time. I built the computer vision part. YOLOv8 with instance segmentation, bounding boxes and coloured masks drawn with OpenCV, served as an MJPEG stream through Flask into a browser dashboard.

The hard part wasn’t the model. It was speed. No GPU, just laptops. So I moved inference into its own thread with a frame queue, so the stream never waits for the model, switched to FP16 and shrank the input to 320 pixels. After that the stream ran smoothly on the CPU. A bigger input would have been more accurate. For a live demo in front of a jury, smooth mattered more.

How it works, in plain words. The camera delivers frame after frame. Every frame goes through the model, which returns two things for each object it finds: a box and a mask, meaning exactly the pixels that belong to the trash. OpenCV paints both into the frame in colour. Flask sends the finished frames to the browser as an MJPEG stream, a fast sequence of JPEGs the page shows like a video. Camera and model run separately, connected by a queue, so the video doesn’t stall when the model takes a bit longer.

What I’m taking away: in a live demo, what counts is what runs on the hardware in the room, not what’s most accurate on paper. And performance starts with the architecture, not with the model.

Tools and skills: Python, Ultralytics YOLOv8 with instance segmentation, OpenCV, Flask, threads and queues, half precision, and rapid prototyping under time pressure.

Two hackathons in six weeks, two very different teams. At the Bundesliga Hackathon in April we were three, here we were seven.

Auf Deutsch lesen →