SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2411.19331 · 2024

Talking to DINO: Bridging Self-Supervised Vision Backbones with Language for Open-Vocabulary Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 1 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/2411.19331.json · badge: /api/ran/2411.19331.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
lorebianchi98/Talk2DINO canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
average_text_tokens Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lorebianchi98/Talk2DINO/src/hooks.py
code served (permissive licence) · get_code("0856dea1909e47d8")
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)

# Create small tensors for testing
batch_size = 2
seq_length = 5
embedding_dim = 4

# text_embeddings: shape (batch_size, seq_length, embedding_dim)
text_embeddings = torch.randn(batch_size, seq_length, embedding_dim)

# mask: shape (batch_size, seq_length)
# Create a mask where some tokens are valid (True) and some are not (False)
mask = torch.tensor([
    [True, True, True, False, False],
    [True, True, False, False, False]
], dtype=torch.bool)

ARGS = {
    "text_embeddings": text_embeddings,
    "mask": mask,
    "keep_cls": False,
    "keep_end_seq": 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 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
const_lr Ran
ran; our contract draft was wrong, not the code
lorebianchi98/Talk2DINO/src/train_util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from MediaBrain-SJTU/DISSect, is pointer only (licence: NONE) · get_code("04508bbd793cdfb9")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from MediaBrain-SJTU/DISSect, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

cosine_lr Ran
ran; our contract draft was wrong, not the code
lorebianchi98/Talk2DINO/src/train_util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from VivienLu/UCAT, is pointer only (licence: NONE) · get_code("932d44bbf8bd0e3f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from VivienLu/UCAT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_image_and_text_tensor Ran
ran, honoured the contract we drafted
lorebianchi98/Talk2DINO/src/metrics.py
code served (permissive licence) · get_code("18f13c09e4fe6f6c")
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 3, 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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that implements get_visual_embed
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight_attn_heads = 'conditioned'
        self.linear = nn.Linear(4, 4)
    
    def get_visual_embed(self, visual_feat, attn_maps, dino_feat=None):
        # Returns a tensor of shape (batch_size, feature_dim)
        return self.linear(visual_feat.mean(dim=1))

# Create mock data structure
data = {
    'images': [
        {
            'id': 0,
            'file_name': 'img0.jpg',
            'dino_features': torch.randn(4),
            'self_attn_maps': torch.randn(3, 3),
        },
        {
            'id': 1,
            'file_name': 'img1.jpg',
            'dino_features': torch.randn(4),
            'self_attn_maps': torch.randn(3, 3),
        }
    ],
    'annotations': [
        {
            'image_id': 0,
            'caption': 'A cat',
            'ann_feats': torch.randn(4),
            'text_input_mask': torch.tensor([True, True, True, False]),
            'clip_txt_out_tokens': torch.randn(4, 4),
            'clip_txt_out_tokens_avg': torch.randn(4),
            'clip_second_last_out': torch.randn(4),
            'text_argmax': torch.tensor(2),
        },
        {
            'image_id': 0,
            'caption': 'Another cat',
            'ann_feats': torch.randn(4),
            'text_input_mask': torch.tensor([True, True, False, False]),
            'clip_txt_out_tokens': torch.randn(4, 4),
            'clip_txt_out_tokens_avg': torch.randn(4),
            'clip_second_last_out': torch.randn(4),
            'text_argmax': torch.tensor(1),
        },
        {
            'image_id': 1,
            'caption': 'A dog',
            'ann_feats': torch.randn(4),
            'text_input_mask': torch.tensor([True, True, True, False]),
            'clip_txt_out_tokens': torch.randn(4, 4),
            'clip_txt_out_tokens_avg': torch.randn(4),
            'clip_second_last_out': torch.randn(4),
            'text_argmax': torch.tensor(2),
        }
    ]
}

# Save mock data to a temporary location (we'll use a string path that gets mocked)
import tempfile
import os

temp_dir = tempfile.gettempdir()
mock_path = os.path.join(temp_dir, 'mock_data.pt')
torch.save(data, mock_path)

# Create arguments
ARGS = {
    'path': mock_path,
    'feature_name': 'dino_features',
    'text_features': 'ann_feats',
    'model': None,
    'return_capts_and_imms': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
i2t Ran
ran; our contract draft was wrong, not the code
lorebianchi98/Talk2DINO/src/metrics.py
code served (permissive licence) · get_code("5dbf1b65ee3ef568")
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 1, 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 numpy
import torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal model that satisfies the function's usage
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, images, captions, ret_similarity_matrix=False):
        # images: (batch_size, 4)
        # captions: (5N, 4)
        # Return similarity scores as a 1D tensor
        batch_size = images.shape[0]
        num_captions = captions.shape[0]
        # Simple dot product similarity
        similarities = torch.mm(images, captions.T)  # (batch_size, num_captions)
        return similarities.flatten()

# Create model
model = SimpleModel()

# Create images: (5N, K) where N=2, K=4
# So (10, 4) - 5*2=10 images, 4 features each
npts = 2
images = numpy.random.randn(5 * npts, 4).astype(numpy.float32)

# Create captions: (5N, K) where N=2, K=4
# So (10, 4) - 5*2=10 captions, 4 features each
captions = numpy.random.randn(5 * npts, 4).astype(numpy.float32)

ARGS = {
    "images": images,
    "captions": captions,
    "npts": npts,
    "return_ranks": False,
    "model": model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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 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
process_self_attention Ran
ran; our contract draft was wrong, not the code
lorebianchi98/Talk2DINO/src/hooks.py
code served (permissive licence) · get_code("b5ac7bbd59fafe04")
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
import torch.nn as nn

torch.manual_seed(0)

# Parameters for the function
batch_size = 2
num_tokens = 5
num_attn_heads = 2
embed_dim = 8
scale = 0.5
num_global_tokens = 1

# Construct output tensor
# The function expects output to be reshaped as (batch_size, num_tokens, 3, num_attn_heads, embed_dim // num_attn_heads)
# So output shape should be (batch_size, num_tokens, 3 * num_attn_heads * (embed_dim // num_attn_heads))
# = (batch_size, num_tokens, 3 * embed_dim)
output_shape = (batch_size, num_tokens, 3 * embed_dim)
output = torch.randn(output_shape)

ret_self_attn_maps = False

ARGS = {
    "output": output,
    "batch_size": batch_size,
    "num_tokens": num_tokens,
    "num_attn_heads": num_attn_heads,
    "embed_dim": embed_dim,
    "scale": scale,
    "num_global_tokens": num_global_tokens,
    "ret_self_attn_maps": ret_self_attn_maps,
}
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
t2i Ran
ran; our contract draft was wrong, not the code
lorebianchi98/Talk2DINO/src/metrics.py
code served (permissive licence) · get_code("314ef23cfc918b24")
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 1, 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 numpy
from torch import nn

torch.manual_seed(0)

class DummyModel(nn.Module):
    def __init__(self, dim=4):
        super().__init__()
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, images, queries, ret_similarity_matrix=False):
        # images: (N, dim), queries: (N, dim)
        # Return similarity scores (N,)
        scores = torch.sum(images * queries, dim=1)
        return scores

# Create a small model
model = DummyModel(dim=4)

# Create images array: (5N, K) = (10, 4)
# 5N means 5 images per query, so npts will be 2
images = numpy.random.randn(10, 4).astype(numpy.float32)

# Create captions array: (5N, K) = (10, 4)
captions = numpy.random.randn(10, 4).astype(numpy.float32)

# npts is optional, but can be specified
npts = 2

# return_ranks can be True or False
return_ranks = False

ARGS = {
    "images": images,
    "captions": captions,
    "npts": npts,
    "return_ranks": return_ranks,
    "model": model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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 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
train Ran
ran, honoured the contract we drafted
lorebianchi98/Talk2DINO/src/train_util.py
code served (permissive licence) · get_code("5b444cb020759a17")
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 float, ndim 0, dtype family float, shape () 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
from unittest.mock import Mock

torch.manual_seed(0)

# Define a minimal model
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Define a minimal contrastive loss function
class DummyContrastiveLoss(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, images, annotations, return_similarity_mat=False, 
                self_attn_maps=None, cls=None, text_input_mask=None, 
                text_argmax=None, return_index=False):
        # Compute a dummy loss
        loss = torch.tensor(0.5, requires_grad=True)
        
        if return_index:
            # Return loss and head activations
            batch_head_attivations = torch.randn(2, 1)
            return loss, batch_head_attivations
        else:
            return loss

# Create a minimal dataloader (list of batches)
model = DummyModel()
contrastive_loss = DummyContrastiveLoss()

# Create batch data
batch1 = {
    'annotation': torch.randn(2, 3),
    'image': torch.randn(2, 4),
    'text_argmax': torch.randint(0, 5, (2,)),
    'self_attn_maps': torch.randn(2, 8, 8),
    'dino_features': torch.randn(2, 4),
    'text_input_mask': torch.ones(2, 5),
    'metadata': {
        'annotation_id': torch.tensor([1, 2]),
        'image_id': torch.tensor([10, 20])
    }
}

batch2 = {
    'annotation': torch.randn(2, 3),
    'image': torch.randn(2, 4),
    'text_argmax': torch.randint(0, 5, (2,)),
    'self_attn_maps': torch.randn(2, 8, 8),
    'dino_features': torch.randn(2, 4),
    'text_input_mask': torch.ones(2, 5),
    'metadata': {
        'annotation_id': torch.tensor([3, 4]),
        'image_id': torch.tensor([30, 40])
    }
}

train_dataloader = [batch1, batch2]

# Create optimizer and scheduler
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)
scheduler = Mock(return_value=None)

ARGS = {
    'model': model,
    'train_dataloader': train_dataloader,
    'contrastive_loss': contrastive_loss,
    'optimizer': optimizer,
    'scheduler': scheduler,
    'wandb': False,
    'save_head_attivations': None,
    'n_epochs': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () 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
warn_and_continue Ran
ran, violated the contract we drafted
lorebianchi98/Talk2DINO/src/open_vocabulary_segmentation/datasets/builder.py
code served (permissive licence) · get_code("cc5ea4ff3586026b")
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, shape () 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 warnings

def warn_and_continue(exn):
    """Call in an exception handler to ignore any exception, issue a warning,
    and continue."""
    warnings.warn(repr(exn))
    return True

# The function takes a single parameter: exn (an exception)
# It calls repr(exn) and passes it to warnings.warn()
# So we need to provide an Exception instance

exn = ValueError("Test exception message")

ARGS = {
    "exn": exn
}
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 bool, ndim 0, dtype family float, shape () — shape () 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
generate_caption Not yet run
unverified (harvested, no recorded run)
lorebianchi98/Talk2DINO/dino_extraction_v2.py
code served (permissive licence) · get_code("e56697ee94f100ea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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
cosine_lr 12 other papers
9 dated earlier, 3 later
2203.17274 (2022-03)
Exploring Visual Prompts for Adapting Large-Scale Models
2209.00179 (2022-09)
Universal Vision-Language Dense Retrieval: Learning A Unified Representation Space for Multi-Modal Retrieval
2302.14042 (2023-02)
Knowledge-enhanced Visual-Language Pre-training on Chest Radiology Images
and 9 more not named here
const_lr 3 other papers
2 dated earlier, 1 later
2405.08815 (2024-05)
Efficient Vision-Language Pre-training by Cluster Masking
2409.01936 (2024-09)
Optimizing CLIP Models for Image Retrieval with Maintained Joint-Embedding Alignment
2507.12998 (2025-07)
Differential-informed Sample Selection Accelerates Multimodal Contrastive Learning

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

Open-Vocabulary Segmentation (OVS) aims at segmenting images from free-form textual concepts without predefined training classes. While existing vision-language models such as CLIP can generate segmentation masks by leveraging coarse spatial information from Vision Transformers, they face challenges in spatial localization due to their global alignment of image and text features. Conversely, self-supervised visual models like DINO excel in fine-grained visual encoding but lack integration with language. To bridge this gap, we present Talk2DINO, a novel hybrid approach that combines the spatial accuracy of DINOv2 with the language understanding of CLIP. Our approach aligns the textual embeddings of CLIP to the patch-level features of DINOv2 through a learned mapping function without the need to fine-tune the underlying backbones. At training time, we exploit the attention maps of DINOv2 to selectively align local visual patches with textual embeddings. We show that the powerful semantic and localization abilities of Talk2DINO can enhance the segmentation process, resulting in more natural and less noisy segmentations, and that our approach can also effectively distinguish foreground objects from the background. Experimental results demonstrate that Talk2DINO achieves state-of-the-art performance across several unsupervised OVS benchmarks. Source code and models are publicly available at: https://lorebianchi98.github.io/Talk2DINO/.

For agents

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

get_harvested_code_for_paper("2411.19331")
get_code_for_paper("2411.19331")
have("2411.19331")

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

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

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

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

Connect an agent — have() is free.