[ACMMM 2026] DepthART 的官方代码: 为小型模型重新思考深度任意内容
DepthART scales foundation monocular depth estimation to compact Small, Base, and Large models. The release supports both affine-invariant relative depth and camera-aware metric depth, with optimized inference paths for desktop NVIDIA GPUs and Jetson Orin NX.
| Task | Input | Output | Released variants |
|---|---|---|---|
| Relative depth | RGB image | Affine-invariant depth | TinyViM S/B/L and MobileNetV4 variants at 224 and 448 |
| Metric depth | RGB image and camera intrinsics | Depth in meters | Indoor and outdoor S/B/L at 448 |
| Deployment | Static model input | PyTorch or TensorRT inference | FP32/TF32, AMP, and FP16 |
The current public release provides inference, evaluation, and deployment code. Training code and reproducible training configurations are not included yet.
…| Task | Domain | Scale | Input | Checkpoint |
|---|---|---|---|---|
| Relative | general | S/B/L | 224x224 | checkpoints/relative/depthart_relative__224.pth |
| Relative | general | S/B/L | 448x448 | checkpoints/relative/depthart_relative__448.pth |
| Relative | general | MobileNetV4-S/M | 224x224 or 448x448 | checkpoints/relative/depthart_relative_mnv4_.pth |
| Relative | general | MobileNetV4-M-slim-SPF | 224x224 or 448x448 | checkpoints/relative/depthart_relative_mnv4m_slim_.pth |
| Metric | indoor | S/B/L | 448 | checkpoints/metric/depthart_metric_indoor__448.pth |
| Metric | outdoor | S/B/L | 448 | checkpoints/metric/depthart_metric_outdoor__448.pth |
Pretrained Relative and Metric checkpoints are hosted in the DepthART Hugging Face repository. Model checkpoints and ONNX graphs are not stored in the GitHub repository; download them from Hugging Face after cloning the source code.
Download the complete checkpoint directory into an existing source checkout:
python -m pip install -U huggingface_hub
hf download Fengxue93/DepthART \
--include "relative/**" \
--include "metric/**" \
--local-dir checkpoints
hf download Fengxue93/DepthART \
--include "onnx/**" \
--local-dir deploy/shared
sha256sum -c CHECKSUMS.sha256The Hugging Face repository has three top-level model folders: relative/,
metric/, and onnx/. The commands above place them directly at the runtime
paths shown in the model table and under deploy/shared/onnx/, so no manual file
moves are required. TensorRT engines are device-specific build artifacts and are
not distributed as checkpoints. CHECKSUMS.sha256 covers all 18 checkpoints
and all 18 ONNX graphs, including the six standard-operator MobileNetV4 graphs.
Each checkpoint is an inference-only PyTorch payload with two top-level fields:
model contains the model state dictionary, and validation_metrics contains
only the validation summaries available for that model. Checkpoints do not
include optimizer state, training arguments, epochs, dataset split entries,
image paths, or internal filesystem paths.
The tested PC configuration is defined in environment.yml: Python 3.9, PyTorch 2.1, and CUDA 11.8.
conda env create -f environment.yml
conda activate depthartCompile the PyTorch Selective Scan extension for the current GPU:
MAX_JOBS=4 bash deploy/pc/setup.sh pytorch-onlyFor TensorRT deployment, install a TensorRT development distribution that includes the Python bindings, NvInfer.h, libnvinfer, and libnvinfer_plugin, then run:
MAX_JOBS=4 bash deploy/pc/setup.shThe pip-only TensorRT package does not provide C++ headers, so it is insufficient for compiling the custom plugin. See PC deployment for complete requirements and troubleshooting.
The recommended Orin NX environment uses JetPack 6.2 and NVIDIA's PyTorch 25.06 container. The exact container configuration is defined by deploy/orin_nx/Dockerfile.
On the Orin NX host:
cd DepthART
docker build -f deploy/orin_nx/Dockerfile -t depthart:orin-nx .
sudo nvpmodel -m 0
sudo jetson_clocks
docker run --rm -it \
--runtime nvidia \
--network host \
--ipc host \
-v "$PWD":/workspace/DepthART \
-w /workspace/DepthART \
depthart:orin-nxInside the container, compile the SM87 PyTorch extension and TensorRT plugin:
MAX_JOBS=4 bash deploy/orin_nx/setup.shDo not copy CUDA extensions or TensorRT engines from a PC. Both must be built on the Orin NX against its local CUDA, PyTorch, and TensorRT versions. Continue with Orin NX deployment.
Both inference commands save a float32 NumPy depth map and a colorized PNG.
python relative/infer_image.py \
--image assets/example.png \
--encoder S \
--resolution 224 \
--checkpoint checkpoints/relative/depthart_relative_s_224.pth \
--output outputs/relative_s_224.npyRelative predictions are affine-invariant and should not be interpreted as metric distance.
MobileNetV4 models use the same command with one of MNV4-S, MNV4-M, or
MNV4-M-SLIM-SPF:
python relative/infer_image.py \
--image assets/example.png \
--encoder MNV4-M-SLIM-SPF \
--resolution 448 \
--checkpoint checkpoints/relative/depthart_relative_mnv4m_slim_448.pth \
--output outputs/relative_mnv4m_slim_448.npyThe released MobileNetV4 variants support PyTorch inference and portable, standard-operator ONNX export. The TensorRT benchmark matrix and custom Selective Scan plugin apply to the TinyViM S/B/L models.
Metric inference requires camera intrinsics in the order fx fy cx cy:
python metric/infer_image.py \
--image assets/example.png \
--encoder S \
--domain indoor \
--checkpoint checkpoints/metric/depthart_metric_indoor_s_448.pth \
--intrinsics 525 525 319.5 239.5 \
--output outputs/metric_indoor_s_448.npyUse an indoor checkpoint for indoor cameras and an outdoor checkpoint for outdoor scenes. Intrinsics must correspond to the original input image; preprocessing scales them together with the image.
Set DEPTHART_DATA_ROOT to the directory containing the supported zero-shot datasets:
export DEPTHART_DATA_ROOT=/path/to/Zero_shot_Datasets
python deploy/shared/evaluate_depth.py --output-dir outputs/evaluationRelative evaluation performs per-image scale-and-shift alignment. Metric evaluation uses absolute depth without alignment. The deployment evaluator supports NYUD and KITTI for all released TinyViM S/B/L variants.
MobileNetV4 checkpoints can be evaluated directly with the relative-depth evaluator:
cd relative
python infer_dataset.py \
--encoder MNV4-M --input_height 448 --input_width 448 \
--pretrained_from ../checkpoints/relative/depthart_relative_mnv4m_448.pth \
--eval_datasets NYU KITTI \
--kitti-tiled --tile-stride 128 \
--path-map /path/to/Zero_shot_Datasets="$DEPTHART_DATA_ROOT" \
--output-json ../outputs/mnv4m_448.jsonKITTI is resized with aspect ratio preserved and evaluated with square
horizontal windows. The windows are jointly scale-and-shift aligned from their
overlaps only, blended with a Hann window, and then evaluated with one
per-image disparity affine alignment inside the Eigen crop. Use window/stride
448/128 for 448 checkpoints and 224/64 for 224 checkpoints. Ground truth is
never used to stitch the windows.
Relative-depth results use per-image affine scale-and-shift alignment on the valid ground-truth mask. Metric-depth results use absolute depth without alignment; NYUD uses the indoor checkpoint and KITTI uses the outdoor checkpoint. delta1 is higher-is-better, while AbsRel and RMSE are lower-is-better.
| Model | Dataset | Actual input | TF32 delta1 | TF32 AbsRel | TRT FP32 delta1 | TRT FP32 AbsRel | TRT FP16 delta1 | TRT FP16 AbsRel |
|---|---|---|---|---|---|---|---|---|
| S224 | NYUD | 224x288 | 0.9531 | 0.0664 | 0.9531 | 0.0664 | 0.9529 | 0.0666 |
| S224 | KITTI | 224x736 | 0.9218 | 0.0867 | 0.9218 | 0.0867 | 0.9217 | 0.0868 |
| S448 | NYUD | 448x608 | 0.9642 | 0.0588 | 0.9642 | 0.0588 | 0.9642 | 0.0589 |
| S448 | KITTI | 448x1472 | 0.9298 | 0.0817 | 0.9297 | 0.0818 | 0.9291 | 0.0818 |
| B224 | NYUD | 224x288 | 0.9590 | 0.0620 | 0.9590 | 0.0620 | 0.9589 | 0.0619 |
| B224 | KITTI | 224x736 | 0.9216 | 0.0923 | 0.9215 | 0.0924 | 0.9215 | 0.0922 |
| B448 | NYUD | 448x608 | 0.9691 | 0.0555 | 0.9691 | 0.0555 | 0.9690 | 0.0556 |
| B448 | KITTI | 448x1472 | 0.9297 | 0.0876 | 0.9297 | 0.0876 | 0.9292 | 0.0879 |
| L224 | NYUD | 224x288 | 0.9666 | 0.0561 | 0.9666 | 0.0561 | 0.9662 | 0.0564 |
| L224 | KITTI | 224x736 | 0.9276 | 0.0882 | 0.9277 | 0.0882 | 0.9279 | 0.0881 |
| L448 | NYUD | 448x608 | 0.9707 | 0.0539 | 0.9707 | 0.0538 | 0.9706 | 0.0540 |
| L448 | KITTI | 448x1472 | 0.9315 | 0.0842 | 0.9315 | 0.0842 | 0.9316 | 0.0836 |
Relative-L-224 TensorRT FP16 keeps the final depth prediction head in FP32. This avoids input-dependent FP16 overflow in the released checkpoint while retaining FP16 execution for the backbone and decoder.
The released MobileNetV4 checkpoints use affine-consistent tiled KITTI inference. NYUD uses the native full-image path. All numbers below were reproduced on the complete 654-image NYUD and 652-image KITTI splits:
| Model | Input | NYUD delta1 | NYUD AbsRel | KITTI delta1 | KITTI AbsRel |
|---|---|---|---|---|---|
| MobileNetV4-S | 224 | 0.922 | 0.088 | 0.890 | 0.101 |
| MobileNetV4-S | 448 | 0.934 | 0.082 | 0.910 | 0.091 |
| MobileNetV4-M | 224 | 0.944 | 0.073 | 0.922 | 0.085 |
| MobileNetV4-M | 448 | 0.953 | 0.067 | 0.931 | 0.080 |
| MobileNetV4-M-slim-SPF | 224 | 0.942 | 0.073 | 0.920 | 0.085 |
| MobileNetV4-M-slim-SPF | 448 | 0.952 | 0.068 | 0.928 | 0.082 |
The complete records are in mobilenetv4_relative_accuracy.csv.
All entries use per-image affine alignment in disparity space. Each cell is
delta1 / AbsRel (higher/lower is better). TinyViM rows are the reported
DepthART results, while the other rows were evaluated over every
暂无开放 Issues,或尚未同步最近议题。