Depth Pro 2 MLX โ€” L and H+, oQ6-style, oQ8-style and BF16

These are unofficial Model Derivatives of Apple's Depth Pro 2 for metric monocular depth estimation on Apple Silicon.

Checkpoints

Model BF16 oQ6-style oQ8-style
L 686 MiB 351 MiB 407 MiB
H+ 1,713 MiB 783 MiB 938 MiB

On the M5 Air, BF16 was fastest across the still-image tests. At 720p, oQ6-style reduced weight file size by 49% for L and 54% for H+, and reduced peak MLX memory by 335 MiB and 927 MiB, respectively.

The builds use Appleโ€™s original weights and the Depth Pro 2 model in MLX-VLM 0.8.1 with MLX 0.32.4. The oQ-style method was adapted to depth estimation because stock oMLX quantization preserves vision encoders at full precision. Use the bundles with the Depth Pro 2 predictor in MLX-VLM.

  • BF16 uses BF16 model weights with FP32 inverse-depth and focal heads.
  • oQ6-style uses encoder-only affine weight quantization with groups of 64. Three calibration images supply up to 48 input tokens per linear layer per image. Linear layers compete for promotion to 8-bit based on the reduction in relative squared output error per additional bit, with a 6.7 bits-per-encoder-linear-weight cap including scale and offset storage.
  • oQ8-style applies MXFP8 weight-only quantization in groups of 32 to the same encoder linears.
  • Both quantized builds keep the convolutions, embeddings, norms, DPT decoder and focal estimator at their baseline precision. The integrity check compares the preserved tensors byte for byte.

Run an image on the Mac

Install the tested runtime on an Apple Silicon Mac.

python -m pip install "mlx==0.32.4" "mlx-vlm==0.8.1"

Change the bundle path to select another precision or model size. The download is limited to the selected bundle.

from pathlib import Path

from huggingface_hub import snapshot_download
import mlx.core as mx
import numpy as np
from mlx_vlm import load
from mlx_vlm.models.depth_pro_2.generate import DepthPro2Predictor, read_image

repo_id = "groxaxo/DepthPro2-MLX-oQ6-oQ8"
bundle = "models/DepthPro2-L-oq6-image"
snapshot = Path(snapshot_download(repo_id, token=False, allow_patterns=[f"{bundle}/*"]))
model, processor = load(snapshot / bundle)
predictor = DepthPro2Predictor(model, processor)
result = predictor.infer(read_image("photo.jpg"))
mx.eval(*result.values())
np.savez(
    "depth-result.npz",
    depth_m=np.asarray(result["depth"]),
    inverse_depth=np.asarray(result["inverse_depth"]),
    focal_length_px=result["focallength_px"].item(),
)

The output keeps the original image resolution. Metric depth is measured in meters along the camera's optical axis. Supply the f_px argument when a calibrated focal length in pixels is available.

Results

The original 4-bit bundles are from pratikgx/Depth-Pro-2-MLX-4bit. The benchmark loaded the published tensors directly into MLX-VLM 0.8.1 with strict parameter loading. All four precisions used MLX 0.32.4, identical RGB inputs and the same inference implementation on a 24 GB MacBook Air M5. The Mac ran on AC power with Low Power Mode off.

Which precision should you use?

For speed on the M5 MacBook Air, BF16 was fastest. For the lowest peak MLX memory, the original 4-bit builds used the least. At 720p, oQ6 and oQ8 offered no speed or peak-memory advantage over the original 4-bit. Their benefit was closer depth agreement with BF16 on the Apple photo.

  • L peak MLX memory at 720p was 2,721 MiB with 4-bit, 2,800 MiB with oQ6, and 2,856 MiB with oQ8.
  • H+ peak MLX memory at 720p was 3,014 MiB with 4-bit, 3,234 MiB with oQ6, and 3,388 MiB with oQ8.

Both oQ builds reduced peak MLX memory compared with BF16. These figures describe the 720p still-image inference test on this Mac.

Apple photo at 1280ร—720

Model Precision Weights (MiB) Median (ms) Peak MLX (MiB) Inverse-depth Pearson r Median metric-depth error
L BF16 686.1 626.4 3,135.0 Reference Reference
L Original 4-bit 272.1 676.1 2,721.0 0.998817 3.70%
L oQ6-style 351.1 677.4 2,800.0 0.999911 1.10%
L oQ8-style 407.1 686.5 2,856.0 0.999781 1.33%
H+ BF16 1,712.6 1,156.9 4,161.4 Reference Reference
H+ Original 4-bit 562.6 1,213.1 3,014.4 0.999684 4.14%
H+ oQ6-style 782.5 1,248.3 3,234.4 0.999981 1.59%
H+ oQ8-style 937.6 1,292.6 3,387.9 0.999963 0.43%

720p latency, MLX peak memory, and depth error by precision

Other held-out inputs

Model Precision Native Apple (ms) Motorcycle (ms) Rocket (ms) Lowest inverse-depth Pearson r across four conditions
L BF16 2,372.9 252.1 180.0 Reference
L Original 4-bit 2,486.7 263.9 188.6 0.990357
L oQ6-style 2,532.6 270.2 194.8 0.998852
L oQ8-style 2,543.8 273.6 194.2 0.998620
H+ BF16 4,375.0 466.4 333.0 Reference
H+ Original 4-bit 4,551.5 503.6 343.5 0.996086
H+ oQ6-style 4,687.8 591.8 360.9 0.999390
H+ oQ8-style 5,193.2 510.5 365.8 0.999366

All 32 evaluated outputs had finite inverse depth and zero invalid metric-depth pixels.

Top 10 encoder blocks by KL divergence

Each chart ranks blocks by the largest KL divergence observed across the three quantized builds for that model. KL compares sampled post-block activation distributions against BF16 in nats, with BF16 as the reference distribution. The three held-out scenes were cover-cropped to 384ร—256. The sampler skips the five prefix tokens, keeps every fourth spatial token and uses every channel. Each block uses 64 shared histogram bins based on its BF16 1stโ€“99th percentiles, including two overflow bins and a 0.5 count per bin for smoothing. The logarithmic axis shows smaller as well as larger divergences. Depth-map agreement is reported in the tables above.

L top 10 encoder blocks by activation KL

H+ top 10 encoder blocks by activation KL

All block values (CSV) ยท KL settings and values (JSON) ยท Benchmark JSON and charts

Benchmark method

Timed results are for individual still-image predictions including input normalization, model inference, focal estimation and device evaluation. They exclude disk read, model load and image resizing. Each precision ran in a separate process on the 24 GB Apple M5 MacBook Air, on wall power with Low Power Mode off. Median and per-run timings are in the JSON files.

  • Apple's example photo at 1280ร—720 uses a centered bicubic cover crop, with three warmups and seven timed frames.
  • The same photo at 1920ร—1440 uses two warmups and five timed frames.
  • The held-out motorcycle and rocket photos each use one warmup and three timed frames at their original dimensions.
  • The calibration set uses a frame from Apple's video example and scikit-image's astronaut and coffee photos. Those images are distinct from the benchmark photos.

Pearson r is measured on focal-normalized inverse depth. Metric-depth error uses pixels that are finite in both the quantized output and the corresponding BF16 output. Apple defines zero inverse depth as infinite metric depth. This valid output is counted separately from invalid values. The four conditions cover three distinct still photos and two resolutions of the Apple example. Parity is measured against the matching BF16 checkpoint. Ground-truth depth and streaming latency were outside the benchmark scope.

Reproduce the builds

The benchmark JSON includes per-run latencies, peak MLX memory, parity metrics and calibration scores. To repeat the 4-bit comparison after building the six local checkpoints, run the commands in benchmark-original-4bit.sh. See SHA256SUMS for the published checkpoint hashes and verification.json for upstream checkpoint hashes and tensor comparison counts.

Copy reproduce.sh, depthpro2_mlx.py, and verify_checkpoints.py to an Apple Silicon Mac with uv and ffmpeg. Run bash reproduce.sh in that directory to fetch the pinned inputs, build all six bundles, and rerun the benchmark.

License and attribution

Apple Machine Learning Research Model is licensed under the Apple Machine Learning Research Model License Agreement.

These Model Derivatives use Apple's original L and H+ checkpoints and their shared focal-length estimator. The changes are conversion of convolution kernels to MLX layout, BF16 packing with FP32 heads, and optional weight-only encoder quantization as described above. The conversion used the original trained weights without retraining. The full Apple license applies to each checkpoint and limits use to non-commercial scientific research and academic development. This is a community conversion independent of Apple and oMLX.

Downloads last month

-

Downloads are not tracked for this model. How to track
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for groxaxo/DepthPro2-MLX-oQ6-oQ8

Quantized
(2)
this model