Skip to content

Live depth from any camera

A neural network works out how far away every pixel is, live on a Mac inside TouchDesigner. The agent took a working prototype to a finished .tox in two sittings: model inside, nothing to install, about 11 depth maps a second on an M5 Max while TouchDesigner keeps rendering at 60 fps.

  • Price: PRO
  • MCP
  • 3D

You need

  • TouchDesigner 2025.33230
  • Twozero plugin
  • Mac with Apple silicon

Try this prompt

Find a monocular depth model that runs locally on my Apple-silicon Mac, benchmark the ways to run it, and build a self-contained TouchDesigner component around the fastest one: live depth map from any TOP, model embedded in the .tox, no pip installs, inference off the main thread, presets for slower Macs.

Our suggestion. The real run started from a June prototype, so its first message only makes sense next to it.

Model
Claude Opus 5
Time
~4 hours of agent time
Attention
16 short messages, 4 choices
Price
in PRO

Or take the finished one

Depth AI

in Rudiments · vankrav/depth-ai · v3 · 43.7 MBin Rudiments · v3 · 43.7 MB

Price: PRO
Open in Rudiments

PRO opens every rudiment in the library, not just this one.

Size
43.7 MB
Price
in PRO

What's in this run

  • MCP

    The agent rebuilt the component through the TWOZERO MCP: 595 calls straight into TouchDesigner.

  • Model

    Depth Anything V2 Small, re-converted to CoreML at 994×560 and 518×294, checked against PyTorch (corr 1.000000).

    Apache-2.0
  • Controls

    21 controls on two pages, each with a hint. Three outputs: a colour map, 32-bit raw depth and the delayed source.

Rebuilding it yourself needs a Mac with Apple silicon, TouchDesigner and a one-off Python environment with torch, transformers and coremltools for the conversion.

Once it's in your network

  1. Drop it in: it already shows depth on TouchDesigner's own sample photo.
  2. Wire your camera or any TOP into input 0, and it takes over.
  3. Take raw (32-bit) for displacement or a point cloud; depth is the coloured preview.
  4. On a slower Mac, switch Model to Lite first, then lower Max inference fps.

Warning:Breaks when

  • Windows: it runs on Apple's CoreML, so it is macOS only.
  • Point cloud at full 1920×1080: don't wire the same point set into both inputs of a Copy POP (two million by two million points takes TouchDesigner down). For point clouds, set Output res to Model res or switch Model to Lite.
  • The first drop unpacks and compiles the model once. On an M5 Max it was ready within about 3 seconds.
  • Every speed here was measured on one machine, an M5 Max.

Next step

More runs