Depth Anything Foundation Depth
Label a few images well, then let a teacher label millions. Depth Anything scales that student-teacher loop into a depth model that works anywhere.
Why Does This Exist?
Labeled depth covers a few rooms and streets; the open world covers everything else. Depth Anything exists to break that ceiling with scale: train a teacher on labeled sets, predict pseudo-depth on tens of millions of unlabeled photos, then train a stronger student on the union with a frozen DINOv2 encoder for semantics. Version adds metric heads for indoor and outdoor ranges.
Teacher basics are MiDaS; the encoder-decoder shape is DPT; the diffusion alternative is Marigold.
Think of It Like This
A tutor grading practice exams
A tutor grades a small set by hand, then photocopies answer keys for a huge practice pile. Students drill the whole pile and beat the tutor, because volume plus strong fundamentals beats a few perfect lessons.
Labeled sets are the hand-graded pile and pseudo-labels are the photocopies. The analogy stops at noise: answer keys are exact while pseudo-depth carries teacher errors that need strong augmentation to survive.
How It Actually Works
Stage one trains the teacher with the MiDaS scale-shift loss on labeled data. Stage two runs the teacher over about million unlabeled images, keeps confident predictions, and trains the student with heavy color and crop augmentation plus a feature-alignment loss against frozen DINOv2 so semantics persist. Metric version adds separate indoor and outdoor heads after the relative backbone, selected by a scene classifier. Evaluation stays zero-shot: no test scene appears in training.
Worked numbers
Labeled training uses million frames; unlabeled adds million, a -fold increase. Indoor zero-shot AbsRel drops from teacher to student in the reference split. Pseudo-label filtering keeps the top percent by edge agreement, discarding million noisy frames.
Code
def keep_ratio(kept: float, total: float) -> float: return kept / total # fraction of pseudo-labels trusted
print(keep_ratio(43.4, 62.0)) # -> 0.7Watch Out For
Trusting pseudo-labels on mirrors and sky
The teacher errs systematically on glass, mirrors, and open sky, and the student inherits those errors as truth. The symptom is confident wrong depth on windows across many scenes. Filter by multi-crop agreement and keep sky handling explicit instead of distilling blindly.
The Quick Version
- Depth Anything scales depth with teacher pseudo-labels on unlabeled photos.
- About million extra images train the student past the teacher.
- A frozen DINOv2 encoder preserves open-world semantics.
- Version adds metric indoor and outdoor heads.
- Zero-shot indoor AbsRel lands near after scaling.
- Pseudo-label filtering decides the final quality more than raw count.