SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.05499 · 2023

Grounding DINO: Marrying DINO with Grounded Pre-Training for Open-Set Object Detection

Hang Su, Jun Zhu, Jie Yang, Chunyuan Li, Lei Zhang, Hao Zhang, Jianwei Yang, Kong, Shilong Liu, Feng Li, Tianhe Ren, Zhaoyang Zeng, and 1 more

arXiv · PDF · Open in the Atlas

Code that ran

2 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 3 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/2303.05499.json · badge: /api/ran/2303.05499.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
IDEA-Research/GroundingDINO community
Papers with Code archive
1 ran · 1 no recorded run
IDEA-Research/Grounded-Segment-Anything community
Papers with Code archive
1 ran · 1 no recorded run
longzw1997/Open-GroundingDino community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
ContrastiveEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
IDEA-Research/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py
code served (permissive licence) · get_code("d5c391b32de453d0")
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 an instance of its own class, ContrastiveEmbed: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn

torch.manual_seed(0)

class ContrastiveEmbed(nn.Module):

    def __init__(self, max_text_len=256):
        """
        Args:
            max_text_len: max length of text.
        """
        super().__init__()
        self.max_text_len = max_text_len

    def forward(self, x, text_dict):
        """_summary_

        Args:
            x (_type_): _description_
            text_dict (_type_): _description_
            {
                'encoded_text': encoded_text, # bs, 195, d_model
                'text_token_mask': text_token_mask, # bs, 195
                        # True for used tokens. False for padding tokens
            }
        Returns:
            _type_: _description_
        """
        assert isinstance(text_dict, dict)
        y = text_dict['encoded_text']
        text_token_mask = text_dict['text_token_mask']
        res = x @ y.transpose(-1, -2)
        res.masked_fill_(~text_token_mask[:, None, :], float('-inf'))
        new_res = torch.full((*res.shape[:-1], self.max_text_len), float('-inf'), device=res.device)
        new_res[..., :res.shape[-1]] = res
        return new_res


# Create small tensors for testing
batch_size = 2
d_model = 4
text_len = 5
max_text_len = 256

# x: (bs, some_dim, d_model) - will be used in matrix multiplication with y
x = torch.randn(batch_size, 3, d_model)

# encoded_text: (bs, text_len, d_model)
encoded_text = torch.randn(batch_size, text_len, d_model)

# text_token_mask: (bs, text_len) - True for used tokens, False for padding
text_token_mask = torch.tensor([
    [True, True, True, False, False],
    [True, True, False, False, False]
], dtype=torch.bool)

text_dict = {
    'encoded_text': encoded_text,
    'text_token_mask': text_token_mask
}

ARGS = {
    'max_text_len': 256
}
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 ContrastiveEmbed — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ContrastiveEmbed 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
ContrastiveEmbed Ran
ran on a synthesized input · constructed an object; no result was computed
IDEA-Research/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py
code served (permissive licence) · get_code("d76d1655fad01913")
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 an instance of its own class, ContrastiveEmbed: the run constructed the object and did not call it, so no result was computed. 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
from torch import nn

torch.manual_seed(0)

class ContrastiveEmbed(nn.Module):

    def __init__(self, max_text_len=256):
        """
        Args:
            max_text_len: max length of text.
        """
        super().__init__()
        self.max_text_len = max_text_len

    def forward(self, x, text_dict):
        """_summary_

        Args:
            x (_type_): _description_
            text_dict (_type_): _description_
            {
                'encoded_text': encoded_text, # bs, 195, d_model
                'text_token_mask': text_token_mask, # bs, 195
                        # True for used tokens. False for padding tokens
            }
        Returns:
            _type_: _description_
        """
        assert isinstance(text_dict, dict)
        y = text_dict['encoded_text']
        text_token_mask = text_dict['text_token_mask']
        res = x @ y.transpose(-1, -2)
        res.masked_fill_(~text_token_mask[:, None, :], float('-inf'))
        new_res = torch.full((*res.shape[:-1], self.max_text_len), float('-inf'), device=res.device, dtype=res.dtype)
        new_res[..., :res.shape[-1]] = res
        return new_res

# Setup
batch_size = 2
d_model = 4
text_seq_len = 3
max_text_len = 256

# x: shape (bs, some_dim, d_model) - matrix to be multiplied with encoded_text
# Based on the forward pass: res = x @ y.transpose(-1, -2)
# If y is (bs, 195, d_model), then y.transpose(-1, -2) is (bs, d_model, 195)
# So x must be (bs, ?, d_model) to multiply with (bs, d_model, 195) -> (bs, ?, 195)
x = torch.randn(batch_size, 5, d_model)

# encoded_text: (bs, text_seq_len, d_model)
encoded_text = torch.randn(batch_size, text_seq_len, d_model)

# text_token_mask: (bs, text_seq_len) with True for valid tokens, False for padding
text_token_mask = torch.tensor([[True, True, False], [True, False, False]])

text_dict = {
    'encoded_text': encoded_text,
    'text_token_mask': text_token_mask
}

ARGS = {
    'max_text_len': max_text_len
}

# Instantiate the model and test it
model = ContrastiveEmbed(**ARGS)
output = model(x, text_dict)
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 ContrastiveEmbed — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ContrastiveEmbed 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
GroundingDINO Not yet run
unverified (harvested, no recorded run)
IDEA-Research/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py
code served (permissive licence) · get_code("f4c8ecd8274788c7")
How it ran

no invocation recorded.

GroundingDINO Not yet run
unverified (harvested, no recorded run)
IDEA-Research/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/groundingdino.py
code served (permissive licence) · get_code("c37637f1c959fa14")
How it ran

no invocation recorded.

GroundingDINO Not yet run
unverified (harvested, no recorded run)
longzw1997/Open-GroundingDino/models/GroundingDINO/groundingdino.py
code served (permissive licence) · get_code("5ef1be1466f5a09a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
ContrastiveEmbed
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2407.04619 (2024-07)
COUNTGD: Multi-Modal Open-World Counting

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

including object detection data, grounding data, and caption data, and evaluate the model on both open-set object detection and referring object detection benchmarks. Grounding DINO performs remarkably well on all three settings, including benchmarks on COCO, LVIS, ODinW, and RefCOCO/+/g. Grounding DINO achieves a 52.5 AP on the COCO zeroshot 1 detection benchmark. It sets a new record on the ODinW zero-shot benchmark with a mean 26.1 AP. We release some checkpoints and inference codes at https://github.com/IDEA-Research/GroundingDINO.

For agents

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

get_harvested_code_for_paper("2303.05499")
get_code_for_paper("2303.05499")
have("2303.05499")

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

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

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

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

Connect an agent — have() is free.