FocusAnchor

Weights of FocusAnchor from FocusAnchor: Zero-Shot Metric Depth by Anchoring a Depth Foundation Prior to Focus Cues, by Ashkan Ganj, Hang Su and Tian Guo.

Paper | Code | Project page

FocusAnchor predicts metric depth from a focal stack and its all-in-focus image. A recurrent model reads a focus volume and refines depth step by step. At every step it aligns the relative depth of a frozen Depth Anything V2 ViT-L to the current estimate, which carries metric scale from textured regions into regions where focus cues are weak.

Files

File Model SHA-256
FocusAnchor.ckpt FocusAnchor, trained on NYU Depth v2 with five slices 26a2e2ef34933e10b42263fb178c57cc3fd52b2cf120ebc5f15332903daa02c5
FocusAnchor-RS.ckpt FocusAnchor-flex, trained with 2 to 5 slices 63e0f146e36e80dda558d4240ea22605d186b7d489cb9a1d3d0ad22a3b435eca
FocusAnchor-NYU.ckpt NYU in-domain variant d065047a797d1837fd66f2d0edd1f3353fd1cb5674cdd30f6de05e7d6d1db762
FocusAnchor-DDFF12.ckpt FocusAnchor fine-tuned on DDFF12 79ea9d5b980dc39ad8429062848744afe0b2a5c333ba8f133b82680e91d61191
FocusAnchor-RS-DDFF12.ckpt FocusAnchor-flex fine-tuned on DDFF12 3f0a04919c047723daf4195891e68613ce7cb88579dfbacb01f3242993b33f84

Each file holds the trained weights and the model hyper-parameters, nothing else. The frozen Depth Anything V2 ViT-L is left out. The code loads it from depth_anything_v2_vitl.pth, which you download from the Depth Anything V2 repository and put in checkpoints/ next to these files. Those weights are CC-BY-NC-4.0.

Use

git clone https://github.com/cake-lab/FocusAnchor
cd FocusAnchor
uv sync --frozen
uvx --from huggingface_hub hf download AshkanGanj/FocusAnchor --include "*.ckpt" --local-dir checkpoints
uvx --from huggingface_hub hf download depth-anything/Depth-Anything-V2-Large depth_anything_v2_vitl.pth --local-dir checkpoints
uv run python src/cli.py test --config src/configs/test_ZEDD.yaml

The code README lists the dataset setup, the test command for every checkpoint and the training recipes. As a check, test_ZEDD.yaml with FocusAnchor.ckpt prints an AbsRel of about 0.073 on the ZEDD validation scenes. The 4th decimal can differ between GPUs, because the model runs in bf16.

Limits

The models need a focal stack with known focus distances. The NYU models are trained on a rendered stack, since NYU Depth v2 has no real one. Check the licenses of the datasets before use.

Citation

@misc{ganj2026focusanchorzeroshotmetricdepth,
      title={FocusAnchor: Zero-Shot Metric Depth by Anchoring a Depth Foundation Prior to Focus Cues},
      author={Ashkan Ganj and Hang Su and Tian Guo},
      year={2026},
      eprint={2611.32970},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2611.32970},
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Paper for AshkanGanj/FocusAnchor