Depth Output
Estimates depth from the input image and outputs the foreground and background as grayscale.
- Enable — initial value ON. When OFF, the input passes straight through (it does not go black) (
Enableinput /enableInput/isEnabled) - Inference Every N Frames — how many frames between inferences. Minimum 1, initial value 2. The slider in the node UI is 1-10 (
Inference Every N Framesinput /skipFramesInput/inferenceEveryNFrames)
The output is relative depth, normalized to 0-1 using the minimum and maximum values of that frame on each inference. It is not an absolute distance, so if the arrangement of subjects on screen changes, the brightness of the same object changes too. For an image with constant depth (min == max) it is a uniform 0.5.
On frames where no inference is performed, the output buffer is not updated and the previous result remains as it is.
The output resolution is the global resolution (it does not follow the input).
On every inference the depth tensor is downloaded to the CPU and transferred via a temporary Texture2D. This is expensive, so raise Inference Every N Frames if it feels heavy.
The output RT is allocated and published 5 frames after startup. When the input is not connected, the output is filled with black.
Input ports
| Port ID | Type |
|---|---|
Input Texture | RenderTexture |
Enable | bool |
Inference Every N Frames | int |
Output ports
| Port ID | Type |
|---|---|
Depth Output | RenderTexture |
Scriptable members
| Path | Type |
|---|---|
enableInput | bool |
skipFramesInput | int |
isEnabled | bool |
inferenceEveryNFrames | int |
Synapse Apps (scripting)
await synapse.modules.create({ type: "DepthOutput" })