Home

Awesome

Depth-Anything TensorRT in TouchDesigner

<a href="https://discord.com/invite/wNW8xkEjrf"><img src="https://discord.com/api/guilds/838923088997122100/widget.png?style=shield" alt="Discord Shield"/></a>

TouchDesigner implementation for Depth Anything and Depth Anything v2 with TensorRT monocular depth estimation.

Screenshot_68

Features

Usage

Tested with TouchDesigner 2023.11340 & Python 3.11

Install:

  1. Install Python 3.11
  2. Install CUDA Toolkit 11.8
  3. Download TDDepthAnything repository
  4. Open accelerate.bat with text editor and set path to Python 3.11 in set PYTHON_PATH=. (ex. set PYTHON_PATH="C:\Program Files\Python311\python.exe")
  5. Run accelerate.bat

[!TIP] You can use same .venv for TDDepthAnything & TouchDiffusion. Copy all files from TDDepthAnything folder to TouchDiffusion and run accelerate.bat. In TouchDesigner extension, on settings tab select TouchDiffusion folder also.

Accelerate models:

  1. Download Depth-Anything model or Depth-Anything v2 model
  2. Copy model to checkpoints folder
  3. Run accelerate.bat
  4. Select model version (1 - Depth-Anything, 2 - Depth-Anything v2)
  5. Select model size (s - small, b - base, l - large, g - giant)
  6. Select width & height (default is 518x518)
  7. Wait for acceleration to finish

TouchDesigner inference:

  1. Add TDDepthAnything.tox to project
  2. On Settings page change path to TDDepthAnything folder and click Re-init
  3. On Depth Anything page select path to engine file (for ex. engines/depth_anything_vits14.engine) and click Load Engine

Acknowledgement

Based on the following projects: