/media-os:media-depth [input] [output]from media-os
Estimates depth maps from single images or videos using Depth-Anything v2 and MiDaS models. Enables 2.5D parallax, stereo 3D conversion, and Z-depth passes for VFX pipelines.
Ships in media-os. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Context: $ARGUMENTS
Monocular depth estimation — estimate a per-pixel depth map from a single RGB image or video, no stereo rig or LiDAR required. Two actively maintained open-source model families with commercial-safe licenses: Depth-Anything v2 (Apache 2.0, current SOTA, 2024) and MiDaS v3.1 (MIT, Intel ISL, long-standing baseline).
depth.py image --model depthanything-v2)depth.py video)depth.py stereo --baseline 6.5)depth.py parallax --frames 30)depth.py install <model>)references/models.md on Depth-Anything v2 metric fine-tunes.Depth-Anything v2 is distributed via HuggingFace transformers using the pipeline("depth-estimation", ...) API — no custom model code required. MiDaS also works through transformers (using the DPTForDepthEstimation class).
PEP 723 header in scripts/depth.py declares the full dependency set. Running via uv run handles an ephemeral venv. Manual install:
pip install torch transformers opencv-python numpy pillow
On Apple Silicon, PyTorch picks MPS automatically when you set device="mps". On NVIDIA, device="cuda". The helper auto-selects.
Verify the runtime:
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py install depthanything-v2 --size small
Downloads the depth-anything/Depth-Anything-V2-Small-hf weights (~100 MB) into ~/.cache/huggingface/hub/.
| Model | License | Variants | Relative/Metric | Notes |
|---|---|---|---|---|
depthanything-v2 (default) | Apache 2.0 | small / base / large | Relative (inverse depth) | SOTA 2024, crisper edges than v1; metric fine-tunes exist for indoor/outdoor |
midas | MIT | dpt-swinv2-tiny-256 / dpt-beit-large-512 | Relative | Intel ISL v3.1, older, still robust |
Pick by size vs accuracy:
depthanything-v2 --size small — ~25 M params, ~40 fps 1080p on a 3090depthanything-v2 --size base — ~97 M params, ~20 fpsdepthanything-v2 --size large — ~335 M params, ~8 fps, sharpest edgesFull per-model speed, VRAM, and license matrix in references/models.md. Read it when picking a model for batch video or embedded deployment.
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py image \
--model depthanything-v2 --size small \
--in photo.jpg --out depth.png
Outputs a 16-bit single-channel PNG where 0 = far, 65535 = near (the HuggingFace pipeline yields "inverse depth", higher = closer). Also writes depth_preview.png — a turbo-colormap 8-bit visualization for human inspection.
Useful flags:
--out-format npy — raw float32 numpy .npy (best fidelity for VFX tools)--out-format exr — 32-bit EXR (requires opencv-python built with OpenEXR; otherwise install pip install OpenEXR imath or use the .npy path and convert with vfx-oiio / ffmpeg-ocio-colorpro)--invert — flip so that 0 = near, 65535 = far (Blender / most DCCs expect this)uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py video \
--model depthanything-v2 --size small \
--in input.mp4 --out depth.mp4
Writes a grayscale H.264 MP4 at the source fps where each pixel encodes depth (8-bit). For compositing fidelity prefer:
--out-format png-seq --out depth_frames/ # 16-bit PNG sequence, frame_%06d.png
--out-format exr-seq --out depth_exr/ # 32-bit EXR sequence (best for Nuke)
Gotcha: per-frame monocular depth is temporally unstable — the depth of a static object can flicker frame-to-frame. Use --smooth temporal for a light 3-tap EMA across frames, or hand the output to ffmpeg-denoise-restore (hqdn3d on the grayscale depth track) before consuming it downstream.
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py stereo \
--model depthanything-v2 --size base \
--in photo.jpg \
--out-left left.png --out-right right.png \
--baseline 6.5
--baseline is the interpupillary-distance shift in pixels (or millimeters at 96 dpi — it's an opinionated single scalar). Typical values:
3.0 — subtle parallax for phone viewing6.5 — the physical human IPD in mm; gives a natural "window" look12.0 — exaggerated for VR / anaglyphThe occlusion-aware parallax math (forward-warp with depth-sorted Z-buffer, then inpaint revealed background) is documented in references/parallax-math.md — read it when you need to tune the quality / hole-filling trade-off.
Pack side-by-side for a 3D TV / Meta Quest:
ffmpeg -i left.png -i right.png -filter_complex hstack sbs.png
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py parallax \
--image photo.jpg --depth depth.png \
--out parallax.mp4 \
--frames 120 --fps 30 \
--motion orbit --amplitude 40
--motion presets:
orbit — smooth circular camera orbit (best default)zoom — dolly in toward the nearest planepan-left / pan-right — horizontal slide with depth-correct parallaxken-burns — slow zoom + slight pan--amplitude is the max pixel shift of the nearest foreground. Values 20–80 work well for 1080p stills. Hole-fill is done via OpenCV INPAINT_TELEA on the revealed background — the reference doc covers why TELEA beats NS for this specific use case.
If you have both the --image and --depth already, parallax is a pure post-process (no model inference). Chain it after Step 3.
scripts/depth.py — subcommands: image, video, stereo, parallax, install. Each supports --dry-run, --verbose, --device {auto,cpu,cuda,mps}.references/models.md when picking between Depth-Anything v2 variants, switching to MiDaS, or needing metric (in-meters) depth rather than relative.references/parallax-math.md when tuning the occlusion-aware warp, debugging hole-fill artifacts, or implementing a custom stereo baseline model.references/LICENSES.md before shipping commercial output — all models listed here are Apache 2.0 or MIT, but the commercial-safety boundary for derivative depth maps vs the model weights themselves has nuances worth knowing.Depth-Anything-V2-Metric-Indoor-* / -Outdoor-*), which are Apache 2.0 but trained on NC-licensed datasets (Hypersim, KITTI) — the output is commercial-safe; the training data license does not transfer. See references/LICENSES.md.--invert in that case.--out-format png-seq or exr-seq for any downstream Z-depth workflow.--smooth temporal) or denoise the depth track before using it as a camera-tracking signal.--device cpu (slower but accurate) or downscale first.--baseline for stereo is pixels, not cm. Despite the hint "6.5 mm IPD," the scalar is in image pixels at the source resolution. Scale proportionally if you resize.INPAINT_TELEA on the revealed background beats NS for single-image parallax because it preserves edge continuity where the foreground pulled away — see references/parallax-math.md.uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py image \
--model depthanything-v2 --size small \
--in portrait.jpg --out portrait_depth.png --invert
Produces a 16-bit grayscale PNG where near objects are dark, far is bright (Blender convention).
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py video \
--model depthanything-v2 --size base \
--in plate.mov --out depth_exr/ --out-format exr-seq \
--smooth temporal
Writes depth_exr/frame_000001.exr … — 32-bit float Z-depth per frame with light temporal smoothing.
# 1. depth
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py image \
--model depthanything-v2 --size base \
--in lake.jpg --out lake_depth.png
# 2. stereo pair
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py stereo \
--in lake.jpg --depth lake_depth.png \
--out-left L.png --out-right R.png --baseline 8.0
# 3. pack as SBS
ffmpeg -y -i L.png -i R.png -filter_complex hstack lake_sbs.png
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py image \
--model depthanything-v2 --size small \
--in hero.jpg --out hero_depth.png
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py parallax \
--image hero.jpg --depth hero_depth.png \
--out hero_parallax.mp4 \
--motion orbit --frames 150 --fps 30 --amplitude 35
Hand off to media-batch:
ls in/*.jpg | parallel --jobs 4 \
uv run ${CLAUDE_SKILL_DIR}/scripts/depth.py image \
--model depthanything-v2 --size small \
--in {} --out out/{/.}_depth.png
OSError: Can't load tokenizer/image processor for 'depth-anything/Depth-Anything-V2-Small-hf'Cause: No network on first run, or HF Hub outage.
Solution: Pre-download with depth.py install depthanything-v2 --size small when the network is up; weights cache to ~/.cache/huggingface/hub/ and work offline after.
Cause: HuggingFace convention is inverse-depth (near=bright); most DCCs want the opposite.
Solution: Re-run with --invert. Or post-process: python -c "import cv2,numpy as np; d=cv2.imread('d.png',-1); cv2.imwrite('d_inv.png', 65535 - d)".
Cause: Monocular per-frame depth is temporally unstable.
Solution: Add --smooth temporal. For stronger stability, hand off the depth video to ffmpeg-denoise-restore with hqdn3d=4:3:6:4.5, or upgrade to a video-aware model (none of those are Apache/MIT as of April 2026 — track updates in references/models.md).
Cause: Parallax baseline too large for the depth range; hole-fill can't invent enough background.
Solution: Reduce --baseline (try 3.0–5.0), or supply a higher-quality depth map (--size large).
RuntimeError: MPS backend out of memoryCause: Apple Silicon MPS allocator fragments on large images.
Solution: --device cpu (slower), or downscale the input (ffmpeg -i in.jpg -vf scale=1280:-1 small.jpg) before running depth.
ffmpeg not found when writing video outputCause: The video subcommand shells out to ffmpeg for encoding.
Solution: brew install ffmpeg (macOS) or your distro equivalent — the ffmpeg-transcode skill has install details.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
depth-estimation, depth-anything, midas, monocular-depth, 2.5d-parallax, stereo-3d
npx claudepluginhub damionrashford/media-os --plugin media-os110 skills in this plugin
/audio-coreaudioManipulate macOS audio at the Core Audio HAL layer: afinfo (audio file metadata), afplay (play), afconvert (convert format/rate/bit-depth/channel layout), say (TTS), SwitchAudioSource (change default input/output/system device — brew install switchaudio-osx), audiodevice CLIs (npm/Go variants), AppleScript via osascript to drive System Preferences Sound. HAL plugins at /Library/Audio/Plug-Ins/HAL/ load virtual drivers (BlackHole 2ch/16ch/64ch, Loopback, Background Music). Aggregate Device (drift-corrected multi-in) and Multi-Output Device via Audio MIDI Setup.app or AudioHardwareCreateAggregateDevice. Use when the user asks to change default macOS audio device, route audio between apps on Mac, install BlackHole, build an Aggregate Device, convert audio files with afconvert, or script Mac audio from the terminal.
/audio-jackRoute professional low-latency audio with JACK Audio Connection Kit (jackaudio.org): jackd server (ALSA/CoreAudio/PortAudio/ASIO backends), jack_control (D-Bus JACK2 config), jack_lsp (list ports/connections), jack_connect/jack_disconnect (manage links), jack_cpu_load, jack_samplerate, jack_bufsize (runtime period size), jack_transport, jack_rec (multi-channel WAV recording), jack_iodelay (round-trip latency), jack_wait, jack_midi_dump. JACK1 C maintenance vs JACK2 C++ multicore. Modern Linux swaps jackd for PipeWire's libjack shim — same client API. JackTrip for uncompressed multichannel UDP over the Internet. Use when the user asks to run a JACK server, connect audio clients, measure roundtrip latency, record from JACK ports, set JACK period size, or bridge JACK over the network with JackTrip.
Other plugins' skills for the same job