T. Yang
Case study · 03

AR Recyclable Detection

A real-time vision pipeline that outlines recyclables through AR glasses for the people sorting them. The interesting problem was getting it under a frame budget.

Status
Complete
Year
Jan - Apr 2026
Team
4 people
Stack
Python · YOLO-World · MobileSAM · OpenCV
Source
github.com/tianyiy-tim/AR-Recycle-CV-TC350

1.0 Summary

Recycling-facility sorters stand at a moving belt and decide, item by item, what a thing is made of. This pairs YOLO-World detection with MobileSAM segmentation to draw a precise contour around each recyclable and overlay it in the sorter's field of view through AR glasses.

The pipeline itself is short. The work was in the budget: a naive version using full SAM took roughly 500 ms a frame, which is not a live overlay, it is a slideshow. Swapping in MobileSAM and staggering detection against segmentation across frames brought that to about 8 ms (Section 5.0). Built with three others, alongside a design report on the accuracy and latency tradeoff and the safety constraints an eyewear device has to meet.

2.0 Background & Problem

2.1 Sorting Under Time Pressure

Sorting is a classification task done by a person under time pressure, on a belt that does not stop. Anything that helps has to keep up with the belt, and anything that lags is worse than nothing, because a contour drawn around where an item used to be is actively misleading.

That sets the requirement before any model choice: whatever runs has to finish inside a frame.

2.2 Why a Contour, Not a Box

A bounding box is the cheap answer and it is the wrong shape for this. Overlaid on a real object it covers the neighbours as much as the target, and on a cluttered belt that makes the overlay ambiguous exactly when it needs to be precise. What the sorter needs is the outline of the thing they are about to pick up.

So the pipeline needs both stages: something that decides what and where, and something that traces the edge.

3.0 Goals & Scope

3.1 In Scope

  • Detecting recyclable items in a live camera feed.
  • Segmenting each detection down to a precise contour.
  • Overlaying those contours in the wearer's view in real time.
  • A written analysis of the accuracy and latency tradeoff, the stakeholder needs, and the safety standard the hardware has to meet.

3.2 Out of Scope

  • Actuating anything. The system tells a person what it sees; it does not sort.
  • Material classification beyond the detector's own vocabulary.
  • Building the eyewear. The safety work is analysis, not fabrication.

4.0 Pipeline

Two stages, deliberately separable, which is what Section 5.2 exploits.

4.1 Open-Vocabulary Detection

YOLO-World does the detection. It is open-vocabulary, which matters here: a fixed-class detector has to be retrained to recognise a new container, whereas an open-vocabulary one takes the class list as text at inference time. For a waste stream where the set of things on the belt is long and changes, that is the difference between a research demo and something adjustable on site.

4.2 Segmentation

MobileSAM takes each detection and returns a mask. Prompting a segmentation model with a box the detector already produced is much cheaper than asking it to segment the whole frame unprompted, and the mask is what becomes the drawn contour.

5.0 Latency

5.1 500 ms Is Not Real Time

The first working version ran full SAM and took around 500 ms per frame. That is two frames a second. For an overlay attached to someone's head, that is unusable: by the time the contour is drawn the wearer has moved, the belt has moved, and the outline is sitting over the wrong object.

Two changes got it to roughly 8 ms, about sixty times faster.

5.2 Staggering Across Frames

  1. MobileSAM instead of SAM. A distilled image encoder with the same prompt interface, so the swap is close to a drop-in and the mask quality holds up at this scale of object.
  2. Stagger the two stages across frames. Detection and segmentation do not both have to run on every frame. Objects on a belt do not change identity between consecutive frames, so detection can run at a lower rate than segmentation and the pipeline stops paying for both on the same tick.

The second one is the more interesting change, because it is not a faster model, it is a scheduling decision. It works only because the two stages are separable, which is why the pipeline was built that way.

6.0 Constraints

6.1 Eyewear Safety

Anything worn over the eyes in a facility is safety equipment first and a display second. The design report works against ANSI/ISEA Z87.1, the standard for occupational eye protection, which constrains the physical device: impact resistance, coverage, optical clarity. A heads-up overlay that compromises the lens it is printed on is not shippable no matter how good the model is.

6.2 Accuracy Against Latency

The distilled encoder is a real tradeoff, not a free win. MobileSAM gives up some mask fidelity for the speed, and the report is where that got argued rather than hand-waved: at this object scale, and for an overlay a person glances at rather than measures, a slightly looser contour arriving in time beats a tighter one arriving late.

That is a defensible position for this use, and it would not be for a different one.

7.0 Status & References

Complete, as a four-person team project, delivered with the design report. The detector scripts are in the repository below.