whatisgithub

What is spectacles-yolo-ml-example?

stspanho/spectacles-yolo-ml-example — explained in plain English

Analysis updated 2026-05-18

2TypeScriptAudience · developerComplexity · 3/5Setup · moderate

In one sentence

A Spectacles smart-glasses Lens example that detects a real coffee cup via camera and shows animated steam, with a one-click, no-code model training pipeline.

Mindmap

mindmap
  root((Spectacles coffee ML example))
    What it does
      Detects coffee cup via camera
      Shows animated steam effect
      No-code model training
    Tech stack
      TypeScript
      Lens Studio
      YOLOv7-tiny ONNX
    Use cases
      Learn AR object detection
      Retrain on any object
      Prototype Spectacles Lenses
    Audience
      AR developers
      ML hobbyists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

See a working example of object detection running on Spectacles smart glasses.

USE CASE 2

Retrain the included detector to recognize a different object using your own photos.

USE CASE 3

Learn a no-code pipeline for training a YOLO model using real and AI-generated images.

USE CASE 4

Use the debug overlay to tune detection confidence and performance for a custom Lens.

What is it built with?

TypeScriptLens StudioONNXYOLOv7Replicate

How does it compare?

stspanho/spectacles-yolo-ml-example4ssh1/mine-sweeperachawla19/intuitcode-extension
Stars222
LanguageTypeScriptTypeScriptTypeScript
Last pushed2026-01-31
MaintenanceMaintained
Setup difficultymoderatemoderatemoderate
Complexity3/52/54/5
Audiencedevelopervibe coderdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Lens Studio and Spectacles hardware to test on-device, model training happens via a hosted Replicate form.

The README does not state a license, so reuse terms are unclear.

So what is it?

This project is an example Lens for Snap's Spectacles smart glasses that spots a real coffee cup through the wearer's camera and draws animated steam rising off it. It exists to show, step by step, how someone built an object detector for augmented reality glasses without doing traditional machine learning work themselves. The detection model behind it is trained through a public tool hosted on a service called Replicate. You open that page, fill in a short form, and press run, and the whole training pipeline happens automatically. It combines real photos captured through the Spectacles with computer generated training images made by an image generation model called FLUX, so you do not need to take hundreds of real photos yourself. Another AI model automatically draws the bounding boxes around the object in each training image, removing the need to label anything by hand. Underneath, an object detection model called YOLOv7 tiny is trained on this mixed data and exported into a small file format the glasses can run efficiently. Once trained, you swap in the resulting file to replace the example coffee cup detector, and update one line of code if you renamed what it detects. The Lens itself, built in Snap's Lens Studio tool, lets you place a virtual surface in front of you, look around until the camera spots the object, and see the steam effect appear once detection succeeds. It also includes a debug view that shows exactly what the model is seeing and where it thinks the object is, plus adjustable settings for how confident the model must be before it counts something as a detection, and how often it checks each camera frame to balance accuracy against battery life. The training pipeline, the code powering the detection, and the visual effect are all included as a working, swappable example rather than a general purpose product, and are credited to two named creators. The README does not state a license.

Copy-paste prompts

Prompt 1
Walk me through retraining the coffee cup detector on Replicate to detect a different object.
Prompt 2
Explain how CoffeeMLController.ts and CoffeeDetector.ts work together to detect the cup.
Prompt 3
How do I adjust the scoreThreshold and frameSkip settings to change detection behavior?
Prompt 4
Show me how to swap in a newly trained coffee.onnx file into this Lens Studio project.

Frequently asked questions

What is spectacles-yolo-ml-example?

A Spectacles smart-glasses Lens example that detects a real coffee cup via camera and shows animated steam, with a one-click, no-code model training pipeline.

What language is spectacles-yolo-ml-example written in?

Mainly TypeScript. The stack also includes TypeScript, Lens Studio, ONNX.

What license does spectacles-yolo-ml-example use?

The README does not state a license, so reuse terms are unclear.

How hard is spectacles-yolo-ml-example to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is spectacles-yolo-ml-example for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.