SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.09414 · 2024

Depth Anything V2

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 7 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.09414.json · badge: /api/ran/2406.09414.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
DepthAnything/Depth-Anything-V2 canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
fabio-sim/Depth-Anything-ONNX community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
add_residual Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
DepthAnything/Depth-Anything-V2/depth_anything_v2/dinov2_layers/block.py
code served (permissive licence) · get_code("5d16d4d4fc573ac7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Build tiny tensors for the function arguments
# x: input tensor, shape (batch=2, features=4)
x = torch.randn(2, 4, dtype=torch.float32)

# brange: indices for where to add residual, shape should be compatible with batch dimension
brange = torch.tensor([0, 1], dtype=torch.long)

# residual: tensor to add, same shape as x
residual = torch.randn(2, 4, dtype=torch.float32)

# residual_scale_factor: scalar multiplier
residual_scale_factor = 0.5

# scaling_vector: optional vector for scaled operations, set to None for first branch
scaling_vector = None

ARGS = {
    "x": x,
    "brange": brange,
    "residual": residual,
    "residual_scale_factor": residual_scale_factor,
    "scaling_vector": scaling_vector,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
drop_add_residual_stochastic_depth Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
DepthAnything/Depth-Anything-V2/depth_anything_v2/dinov2_layers/block.py
code served (permissive licence) · get_code("85f7ffc01945bb72")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn, Tensor
from typing import Callable

torch.manual_seed(0)

# Create a simple residual function that takes a tensor and returns a tensor of same shape
class SimpleResidualFunc(nn.Module):
    def __init__(self, dim: int):
        super().__init__()
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, x: Tensor) -> Tensor:
        # x will have shape (sample_subset_size, n, d)
        # We need to return same shape
        b, n, d = x.shape
        x_flat = x.flatten(1)  # (b, n*d)
        out = self.linear(x_flat)  # (b, n*d)
        return out.view(b, n, d)

# Create input tensor with shape (batch=2, n=3, d=4)
x = torch.randn(2, 3, 4)

# Create a residual function
residual_func = SimpleResidualFunc(dim=3*4)

# Define the sample_drop_ratio parameter
sample_drop_ratio = 0.1

ARGS = {
    "x": x,
    "residual_func": residual_func,
    "sample_drop_ratio": sample_drop_ratio
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
drop_add_residual_stochastic_depth Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fabio-sim/Depth-Anything-ONNX/depth_anything_v2/dinov2_layers/block.py
code served (permissive licence) · get_code("384c2ee5d2dc2afb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

# Define a simple residual function that takes a tensor and returns a tensor of the same shape
class ResidualFunc(nn.Module):
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        # x has shape (batch, n, d)
        # Return a tensor of the same shape
        return x * 0.5

residual_func = ResidualFunc()

# Create input tensor: shape (batch=2, n=3, d=4)
x = torch.randn(2, 3, 4)

# Create arguments dict
ARGS = {
    "x": x,
    "residual_func": residual_func,
    "sample_drop_ratio": 0.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
DepthAnything/Depth-Anything-V2/depth_anything_v2/dinov2_layers/drop_path.py
code served (permissive licence) · get_code("c157f5b112b3a392")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small tensor for drop_path
# The function uses x.shape[0] for batch dimension and x.ndim for number of dimensions
# It also calls x.new_empty() and performs element-wise operations
x = torch.randn(2, 4, 3, 5)  # batch=2, then 3 other dimensions with distinct sizes

ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
drop_path Ran
ran on a synthesized input
fabio-sim/Depth-Anything-ONNX/depth_anything_v2/dinov2_layers/drop_path.py
code served (permissive licence) · get_code("7fd11117910b59f9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct a small tensor with batch size 2 and feature dimension 4
x = torch.randn(2, 4)

# Define arguments for drop_path function
ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_branges_scales Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
DepthAnything/Depth-Anything-V2/depth_anything_v2/dinov2_layers/block.py
code served (permissive licence) · get_code("5be3610fa1fee19e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct a small tensor with shape (batch=2, sequence=4, dim=3)
x = torch.randn(2, 4, 3)

# Define arguments
ARGS = {
    "x": x,
    "sample_drop_ratio": 0.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_2tuple Ran
ran, honoured the contract we drafted
DepthAnything/Depth-Anything-V2/depth_anything_v2/dinov2_layers/patch_embed.py
code served (permissive licence) · get_code("3c04490a215299f2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Test case 1: tuple input with length 2
test_tuple = (5, 7)

# Test case 2: integer input
test_int = 3

# We'll create ARGS with the integer case
ARGS = {
    "x": test_int
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
named_apply Ran
ran; our contract draft was wrong, not the code
DepthAnything/Depth-Anything-V2/depth_anything_v2/dinov2.py
code served (permissive licence) · get_code("e7fcb6d9ac9deaf4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned SimpleModel. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple nested module structure
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Sequential(
            nn.Linear(3, 2),
            nn.ReLU()
        )
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        return x

# Create a simple callback function that tracks module names
collected_modules = []

def callback_fn(module, name):
    collected_modules.append((name, type(module).__name__))

# Instantiate the module
module = SimpleModel()

# Define ARGS dictionary with all parameters
ARGS = {
    'fn': callback_fn,
    'module': module,
    'name': '',
    'depth_first': True,
    'include_root': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
named_apply Ran
ran; our contract draft was wrong, not the code
fabio-sim/Depth-Anything-ONNX/depth_anything_v2/dinov2.py
code served (permissive licence) · get_code("e1b62c034a7d44aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned NestedModule. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple nested module structure
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)

class NestedModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.child1 = SimpleModule()
        self.child2 = nn.Linear(4, 2)

module = NestedModule()

# Create a callback function that the named_apply will call
# It receives module and name parameters
def callback_fn(module, name):
    pass

ARGS = {
    'fn': callback_fn,
    'module': module,
    'name': '',
    'depth_first': True,
    'include_root': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NestedModule — a NestedModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NestedModule output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 4 the same month, 6 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
named_apply 26 other papers
8 dated earlier, 1 the same month, 15 later, 2 undated
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2204.07683 (2022-04)
Safe Self-Refinement for Transformer-based Domain Adaptation
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
and 23 more not named here
drop_add_residual_stochastic_depth 21 other papers
5 dated earlier, 2 the same month, 12 later, 2 undated
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
and 18 more not named here
make_2tuple 20 other papers
5 dated earlier, 14 later, 1 undated · 1 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
and 17 more not named here
drop_path 18 other papers
5 dated earlier, 12 later, 1 undated · 2 only as an assembly brick
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
and 15 more not named here
add_residual 17 other papers
4 dated earlier, 2 the same month, 10 later, 1 undated
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
2402.03138 (2024-02)
Just Cluster It: An Approach for Exploration in High-Dimensions using Clustering and Pre-Trained Representations
and 14 more not named here
get_branges_scales 17 other papers
4 dated earlier, 2 the same month, 10 later, 1 undated
2304.07193 (2023-04)
DINOv2: Learning Robust Visual Features without Supervision
2312.02366 (2023-12)
Evaluating General Purpose Vision Foundation Models for Medical Image Analysis: An Experimental Study of DINOv2 on Radiology Benchmarks
2402.03138 (2024-02)
Just Cluster It: An Approach for Exploration in High-Dimensions using Clustering and Pre-Trained Representations
and 14 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

This work presents Depth Anything V2. Without pursuing fancy techniques, we aim to reveal crucial findings to pave the way towards building a powerful monocular depth estimation model. Notably, compared with V1, this version produces much finer and more robust depth predictions through three key practices: 1) replacing all labeled real images with synthetic images, 2) scaling up the capacity of our teacher model, and 3) teaching student models via the bridge of large-scale pseudo-labeled real images. Compared with the latest models built on Stable Diffusion, our models are significantly more efficient (more than 10x faster) and more accurate. We offer models of different scales (ranging from 25M to 1.3B params) to support extensive scenarios. Benefiting from their strong generalization capability, we fine-tune them with metric depth labels to obtain our metric depth models. In addition to our models, considering the limited diversity and frequent noise in current test sets, we construct a versatile evaluation benchmark with precise annotations and diverse scenes to facilitate future research.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.09414")
get_code_for_paper("2406.09414")
have("2406.09414")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.09414.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.09414.svg)](https://syntology.ai/paper/2406.09414)

Connect an agent — have() is free.