SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.13842 · 2024

D-FINE: Redefine Regression Task in DETRs as Fine-grained Distribution Refinement

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 9 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2410.13842.json · badge: /api/ran/2410.13842.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
Peterande/D-FINE canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
FunctionStatusWhere it lives
dictify Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/core/yaml_utils.py
code served (permissive licence) · get_code("55ac89cb59e7fe93")
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 dict. 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 numpy as np
from typing import Any, Dict, List, Optional

torch.manual_seed(0)

# Construct arguments for dictify(s: str, v: Any) -> Dict

# Test case 1: Simple string without dots
s1 = "key"
v1 = "value"

# Test case 2: Nested string with single dot
s2 = "outer.inner"
v2 = 42

# Test case 3: Deeply nested string with multiple dots
s3 = "level1.level2.level3"
v3 = [1, 2, 3]

# We'll use the first test case for ARGS
ARGS = {
    "s": "config.model.hidden_size",
    "v": 256
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
elementwise_box_iou Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/misc/box_ops.py
code served (permissive licence) · get_code("f032fa04460c4fc9")
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, ndim 2, dtype family float; 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 torchvision

torch.manual_seed(0)

# Create two batches of bounding boxes in [x1, y1, x2, y2] format
# N=2 boxes per batch
boxes1 = torch.tensor([
    [0.0, 0.0, 10.0, 10.0],
    [5.0, 5.0, 15.0, 15.0]
], dtype=torch.float32)

boxes2 = torch.tensor([
    [5.0, 5.0, 15.0, 15.0],
    [10.0, 10.0, 20.0, 20.0]
], dtype=torch.float32)

ARGS = {
    "boxes1": boxes1,
    "boxes2": boxes2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — 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
elementwise_generalized_box_iou Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Peterande/D-FINE/src/misc/box_ops.py
code served (permissive licence) · get_code("96986c2e89b1597c")
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 1, dtype family float, shape (2,) 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 torchvision

torch.manual_seed(0)

# Create two batches of 2 bounding boxes each
# Format: [x1, y1, x2, y2] where x2 >= x1 and y2 >= y1
boxes1 = torch.tensor([
    [10.0, 20.0, 50.0, 60.0],
    [5.0, 5.0, 30.0, 35.0]
], dtype=torch.float32)

boxes2 = torch.tensor([
    [15.0, 25.0, 55.0, 65.0],
    [8.0, 10.0, 40.0, 40.0]
], dtype=torch.float32)

ARGS = {
    "boxes1": boxes1,
    "boxes2": boxes2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
extract_schema Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/core/workspace.py
code served (permissive licence) · get_code("1202e5e128785814")
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 dict. 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 inspect
from types import ModuleType

# Create a simple test class with various argument patterns
class SimpleModule:
    """A test class with required and optional arguments"""
    def __init__(self, required_arg, optional_arg=42, another_optional="default"):
        self.required_arg = required_arg
        self.optional_arg = optional_arg
        self.another_optional = another_optional
    
    # Add class attributes for __inject__ and __share__
    __inject__ = ['optional_arg']
    __share__ = ['another_optional']


# Create another test class with no special attributes
class AnotherModule:
    def __init__(self, x, y=10):
        self.x = x
        self.y = y


ARGS = {
    'module': SimpleModule
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
generalized_box_iou Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Peterande/D-FINE/src/misc/box_ops.py
code served (permissive licence) · get_code("2f52077940b53c42")
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, 2) 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 torchvision

torch.manual_seed(0)

# Create two sets of bounding boxes in format [x1, y1, x2, y2]
# boxes1: 2 boxes
boxes1 = torch.tensor([
    [0.0, 0.0, 10.0, 10.0],
    [5.0, 5.0, 15.0, 15.0]
], dtype=torch.float32)

# boxes2: 2 boxes
boxes2 = torch.tensor([
    [1.0, 1.0, 11.0, 11.0],
    [6.0, 6.0, 16.0, 16.0]
], dtype=torch.float32)

ARGS = {
    "boxes1": boxes1,
    "boxes2": boxes2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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, 2) — shape (2, 2) 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
load_config Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/core/yaml_utils.py
code served (permissive licence) · get_code("024f9ddd58b25511")
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 dict. 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 copy
import os
import tempfile
from typing import Dict
import yaml

# Create temporary directory and YAML files for testing
tmpdir = tempfile.mkdtemp()

# Create a base config file
base_config = {
    'model': {
        'type': 'bert',
        'hidden_size': 768
    },
    'training': {
        'epochs': 10
    }
}

base_yaml_path = os.path.join(tmpdir, 'base_config.yaml')
with open(base_yaml_path, 'w') as f:
    yaml.dump(base_config, f)

# Create a main config file that includes the base config
main_config = {
    '__include__': ['base_config.yaml'],
    'model': {
        'hidden_size': 512
    },
    'training': {
        'batch_size': 32
    }
}

main_yaml_path = os.path.join(tmpdir, 'main_config.yaml')
with open(main_yaml_path, 'w') as f:
    yaml.dump(main_config, f)

# Define arguments for load_config function
ARGS = {
    'file_path': main_yaml_path,
    'cfg': {}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
merge_dict Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/core/yaml_utils.py
code served (permissive licence) · get_code("288efb4f48e3358a")
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 dict. 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 copy
from typing import Any, Dict, List, Optional

# Construct test dictionaries for merge_dict
dct = {
    "model": {
        "layers": 3,
        "hidden_dim": 64
    },
    "training": {
        "lr": 0.001,
        "epochs": 10
    },
    "data": {
        "batch_size": 32
    }
}

another_dct = {
    "model": {
        "hidden_dim": 128,
        "dropout": 0.5
    },
    "training": {
        "epochs": 20
    },
    "new_key": "new_value"
}

ARGS = {
    "dct": dct,
    "another_dct": another_dct,
    "inplace": True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
register Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/core/workspace.py
code served (permissive licence) · get_code("2a50c87f96494841")
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 function. 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 inspect
from collections import defaultdict
from typing import Any, Dict, List

GLOBAL_CONFIG = defaultdict(dict)

# Test class 1: Simple class with required and optional arguments
class SimpleModule:
    def __init__(self, input_dim, hidden_dim=64, activation='relu'):
        self.input_dim = input_dim
        self.hidden_dim = hidden_dim
        self.activation = activation

# Test class 2: Class with inject and share attributes
class AdvancedModule:
    __inject__ = ['config']
    __share__ = ['model_name']
    
    def __init__(self, config, model_name='default', learning_rate=0.001):
        self.config = config
        self.model_name = model_name
        self.learning_rate = learning_rate

# Test function for registration
def simple_function(x, y, z=10):
    return x + y + z

# Test class 3: Another simple class
class AnotherModule:
    def __init__(self, size):
        self.size = size

# Create test dictionary for registration
test_dict = {}

# Create test class for registration
class TestContainer:
    pass

ARGS = {
    'dct': test_dict,
    'name': None,
    'force': 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
setup_distributed Ran
ran, violated the contract we drafted
Peterande/D-FINE/src/misc/dist_utils.py
code served (permissive licence) · get_code("a65eab71a65df60e")
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 bool, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 random
import numpy as np
import os

torch.manual_seed(0)

ARGS = {
    'print_rank': 0,
    'print_method': 'builtin',
    'seed': 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, rich, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (import:TypeError)
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
warp_model Ran
ran; our contract draft was wrong, not the code
Peterande/D-FINE/src/misc/dist_utils.py
code served (permissive licence) · get_code("18349a0bf298c043")
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 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
from torch.nn.parallel import DataParallel as DP
from torch.nn.parallel import DistributedDataParallel as DDP

torch.manual_seed(0)

# Create a minimal model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.bn = nn.BatchNorm1d(3)
    
    def forward(self, x):
        return self.bn(self.linear(x))

model = SimpleModel()

ARGS = {
    'model': model,
    'sync_bn': False,
    'dist_mode': 'ddp',
    'find_unused_parameters': False,
    'compile': False,
    'compile_mode': 'reduce-overhead'
}
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 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
all_gather Not yet run
unverified (harvested, no recorded run)
Peterande/D-FINE/src/misc/logger.py
code served (permissive licence) · get_code("0216311af005f21f")
How it ran

no invocation recorded.

create Not yet run
unverified (harvested, no recorded run)
Peterande/D-FINE/src/core/workspace.py
code served (permissive licence) · get_code("eb5e01d60557539c")
How it ran

no invocation recorded.

de_model Not yet run
unverified (harvested, no recorded run)
Peterande/D-FINE/src/misc/dist_utils.py
code served (permissive licence) · get_code("8c4ff9fb866ea191")
How it ran

no invocation recorded.

reduce_dict Not yet run
unverified (harvested, no recorded run)
Peterande/D-FINE/src/misc/logger.py
code served (permissive licence) · get_code("e6c2f1b16c9d4813")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 12 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
all_gather 1 other paper
1 later
Wang_Object_Detection_using_Event_Camera_A_MoE_Heat_Conduction_based_CVPR_2025_paper (2025 (year only))
Object Detection using Event Camera: A MoE Heat Conduction based Detector and A New Benchmark Dataset
reduce_dict 1 other paper
1 later
Wang_Object_Detection_using_Event_Camera_A_MoE_Heat_Conduction_based_CVPR_2025_paper (2025 (year only))
Object Detection using Event Camera: A MoE Heat Conduction based Detector and A New Benchmark Dataset

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-23.

Repositories linked to this paper

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

Abstract

We introduce D-FINE, a powerful real-time object detector that achieves outstanding localization precision by redefining the bounding box regression task in DETR models. D-FINE comprises two key components: Fine-grained Distribution Refinement (FDR) and Global Optimal Localization Self-Distillation (GO-LSD). FDR transforms the regression process from predicting fixed coordinates to iteratively refining probability distributions, providing a fine-grained intermediate representation that significantly enhances localization accuracy. GO-LSD is a bidirectional optimization strategy that transfers localization knowledge from refined distributions to shallower layers through self-distillation, while also simplifying the residual prediction tasks for deeper layers. Additionally, D-FINE incorporates lightweight optimizations in computationally intensive modules and operations, achieving a better balance between speed and accuracy. Specifically, D-FINE-L / X achieves 54.0% / 55.8% AP on the COCO dataset at 124 / 78 FPS on an NVIDIA T4 GPU. When pretrained on Objects365, D-FINE-L / X attains 57.1% / 59.3% AP, surpassing all existing real-time detectors. Furthermore, our method significantly enhances the performance of a wide range of DETR models by up to 5.3% AP with negligible extra parameters and training costs. Our code and pretrained models: https://github.com/Peterande/D-FINE.

For agents

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

get_harvested_code_for_paper("2410.13842")
get_code_for_paper("2410.13842")
have("2410.13842")

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

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

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

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

Connect an agent — have() is free.