How zzz512/promptdepth works
PromptDepth is a promptable monocular-depth system with stereo/video depth, interactive prompts, and mask-guided tracking, plus a training pipeline. The graph follows the README’s documented workflows and sampled model/data code; several entrypoint implementations were not sampled, so their documented connections are shown without finer internal call details.
Main entry points: dpt.py PromptDepth model · video_infer.py Stereo/video inference · video_prompt_infer.py Mask-guided tracking · inference.py Image inference
Components 19
User workflows
- Image inference
inference.py - Stereo/video inference
video_infer.py - Mask-guided tracking
video_prompt_infer.py - Interactive demo
demo.py - TensorRT inference
trt_inference.py
Training data
- Training entrypoint
train.py - Paired-frame dataset
dataset/dataset.py - Dataset preparation
dataset - Data transforms
dataset/transform.py
Depth model
- PromptDepth model
prompt_depth/dpt.py - DINOv2 encoder
prompt_depth/dinov2.py - Prompt encoder
prompt_depth/util/prompt_encoder.py - Prompt transformer
prompt_depth/util/transformer.py
Video utilities
- Depth visualization
tools/visualize_depth_video.py - Masked video rendering
tools/create_prompt_video.py
Other components
- User
- Model checkpoint
- Depth outputs
- Video frames and masks
Connections 34
- User → Image inference: runs image inference
- User → Stereo/video inference: runs video depth
- User → Mask-guided tracking: starts tracking
- User → Interactive demo: opens demo
- Image inference → Model checkpoint: loads checkpoint
- Stereo/video inference → Model checkpoint: loads checkpoint
- Mask-guided tracking → Model checkpoint: loads checkpoint
- Interactive demo → Model checkpoint: loads checkpoint
- Image inference → PromptDepth model: predicts depth
- Stereo/video inference → PromptDepth model: predicts paired depth
- Mask-guided tracking → PromptDepth model: predicts prompted depth
- Interactive demo → PromptDepth model: serves predictions
- Image inference → Depth outputs: writes depth
- Stereo/video inference → Depth outputs: writes depth sequence
- Mask-guided tracking → Depth outputs: writes prompted sequence
- User → Training entrypoint: starts training
- Dataset preparation → Paired-frame dataset: generates training lists
- Training entrypoint → Paired-frame dataset: loads training pairs
- Paired-frame dataset → Data transforms: transforms samples
- Training entrypoint → PromptDepth model: trains model
- PromptDepth model → DINOv2 encoder: encodes images
- PromptDepth model → Prompt encoder: encodes prompts
- PromptDepth model → Prompt transformer: fuses prompt features
- User → TensorRT inference: runs optimized inference
- TensorRT inference → Depth outputs: returns depth
- User → Depth visualization: visualizes depth sequence
- Depth outputs → Depth visualization: reads depth array
- Depth visualization → Depth outputs: writes color frames
- User → Masked video rendering: renders masked video
- Depth outputs → Masked video rendering: reads depth frames
- Video frames and masks → Masked video rendering: supplies masks
- Masked video rendering → Depth outputs: writes masked video
- Video frames and masks → Stereo/video inference: supplies adjacent frames
- Video frames and masks → Mask-guided tracking: supplies frames and masks