This repository is designed to support the following article: https://derivative.ca/community-post/custom-integration-thread-manager-support-third-party-python-library/72023
TDDepthAnything uses Depth Anything V2 to generate a depth map from a TouchDesigner TOP. Model loading and inference run through Thread Manager so the TouchDesigner interface remains responsive.
The included TDPyEnvManagerContext.yaml configures TDPyEnvManager to create a
Python 3.11 virtual environment at .venv and install requirements.txt
automatically. The initial PyTorch installation is blocking and may make the
first project startup take several minutes.
Requirements are installed automatically when the environment is first
created. They are not reinstalled when .venv already exists. After changing
requirements.txt, either recreate .venv or install the updated requirements
manually through TDPyEnvManager.
- Open
TDDepthAnything.toe. - Allow TDPyEnvManager to create
.venvand install the dependencies. Restart TouchDesigner after the initial setup completes. - On TDDepthAnything, click Load Model. The model is downloaded from
Hugging Face the first time and then read from the local
checkpointscache. - When the model is loaded, click Inference.
- Copy
TDPyEnvManagerContext.yamlandrequirements.txtinto the folder containing your.toeproject. - From the palette, add TDPyEnvManager to the project and activate it.
- Reopen the project and allow TDPyEnvManager to create
.venvand install the dependencies. Restart TouchDesigner after the initial setup completes. - Add
release/TDDepthAnything.toxto the project. - On TDDepthAnything, click Load Model.
- When the model is loaded, click Inference.
Depth Anything V2 models accessed via Hugging Face Transformers library under Apache 2.0 license