SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.05718 · NeurIPS · 2023

Learning Domain-Aware Detection Head with Prompt Tuning

Rui Zhang, Yunji Chen, Ling Li, Haochen Li, Hantao Yao, Xinkai Song, Yifan Hao, Yongwei Zhao

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2306.05718.json · badge: /api/ran/2306.05718.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
Therock90421/DA-Pro canonical (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
FunctionStatusWhere it lives
convert_basic_c2_names Ran
ran; our contract draft was wrong, not the code
Therock90421/DA-Pro/detectron2/checkpoint/c2_model_loading.py
code served (permissive licence) · get_code("e8526a516b4f9206")
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 list, 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 copy
import re

# Analyze the function: it takes a list of strings (original_keys) and applies
# various string transformations to them. It doesn't use any complex objects,
# just list operations and string manipulations.

ARGS = {
    'original_keys': [
        'pred_b',
        'pred_w',
        'conv_b',
        'conv_w',
        'bn_s',
        'bn_bias',
        'bn_rm',
        'bn_riv',
        'bn_gamma',
        'bn_beta',
        'gn_s',
        'gn_bias',
        'res_conv1_norm_weight',
        'conv1_weight',
        'layer_branch1_weight',
        'layer_branch2a_bias',
        'layer_branch2b_weight',
        'layer_branch2c_bias',
        'body_conv_fcn_weight',
        'AnnIndex_lowres',
        'Index_UV_lowres',
        'U_lowres',
        'V_lowres',
    ]
}
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 list, ndim 1, dtype family float — a list 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
convert_basic_clip_names Ran
ran; our contract draft was wrong, not the code
Therock90421/DA-Pro/detectron2/checkpoint/clip_model_loading.py
code served (permissive licence) · get_code("7b7f6e4aa28b1a69")
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 copy

torch_manual_seed = 0

# Analyze the function:
# - original_keys: list[str] - used to iterate and check if 'visual.transformer' in key, 
#   then apply string replacements
# - add_backbone_prefix: bool - controls conditional logic
# - use_whole_clip: bool - controls conditional logic
# - use_fpn_arch: bool - controls conditional logic
# - regionclip: bool - defined in signature but not used in function body

# The function processes lists of strings representing CLIP model weight keys
# It checks for 'visual.transformer' pattern and applies replacements

ARGS = {
    "original_keys": [
        "visual.layer1.0.conv1.weight",
        "visual.layer1.0.conv1.bias",
        "visual.layer2.1.conv2.weight",
        "visual.bn1.weight",
        "visual.bn1.bias"
    ],
    "add_backbone_prefix": True,
    "use_whole_clip": False,
    "use_fpn_arch": False,
    "regionclip": False
}
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 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
convert_c2_detectron_names Ran
ran; our contract draft was wrong, not the code
Therock90421/DA-Pro/detectron2/checkpoint/c2_model_loading.py
code served (permissive licence) · get_code("e36f87059208bb7e")
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 copy
import logging
import re
import torch

torch.manual_seed(0)

# Create a small dictionary of weights simulating Caffe2 model weights
weights = {
    'conv1_w': torch.randn(3, 3, 3, 3),
    'conv1_b': torch.randn(3),
    'res_conv1_norm_s': torch.randn(3),
    'res_conv1_norm_bias': torch.randn(3),
    'res2_0_branch1_w': torch.randn(4, 3, 1, 1),
    'res2_0_branch1_b': torch.randn(4),
    'res2_0_branch2a_w': torch.randn(4, 3, 3, 3),
    'res2_0_branch2a_b': torch.randn(4),
    'res2_0_branch2b_w': torch.randn(4, 4, 3, 3),
    'res2_0_branch2b_b': torch.randn(4),
    'res2_0_branch2c_w': torch.randn(8, 4, 1, 1),
    'res2_0_branch2c_b': torch.randn(8),
    'bn_s': torch.randn(3),
    'bn_bias': torch.randn(3),
    'bn_rm': torch.randn(3),
    'bn_riv': torch.randn(3),
    'pred_w': torch.randn(10, 8),
    'pred_b': torch.randn(10),
    'fpn_inner_res2_2_sum_lateral_w': torch.randn(4, 8, 1, 1),
    'fpn_inner_res2_2_sum_lateral_b': torch.randn(4),
    'fpn_res2_2_sum_w': torch.randn(4, 4, 3, 3),
    'fpn_res2_2_sum_b': torch.randn(4),
    'rpn_cls_logits_w': torch.randn(3, 4, 3, 3),
    'rpn_cls_logits_b': torch.randn(3),
    'rpn_bbox_pred_w': torch.randn(12, 4, 3, 3),
    'rpn_bbox_pred_b': torch.randn(12),
    'fc6_w': torch.randn(16, 8),
    'fc6_b': torch.randn(16),
    'fc7_w': torch.randn(16, 16),
    'fc7_b': torch.randn(16),
}

ARGS = {
    'weights': weights,
}
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, 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
convert_clip_names Ran
ran; our contract draft was wrong, not the code
Therock90421/DA-Pro/detectron2/checkpoint/clip_model_loading.py
code served (permissive licence) · get_code("376248f5d186a885")
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 copy

torch.manual_seed(0)

# Create a small weights dict with CLIP-style keys
# These keys follow the pattern that convert_clip_names expects
weights = {
    'visual.layer1.0.conv1.weight': torch.randn(4, 3, 3, 3),
    'visual.layer1.0.conv2.weight': torch.randn(4, 4, 3, 3),
    'visual.layer2.0.conv1.weight': torch.randn(8, 4, 3, 3),
    'visual.transformer.layer1.weight': torch.randn(4, 4),
    'fpn.inner.res2.2.sum.lateral.weight': torch.randn(4, 3),
    'fpn.res2.2.sum.weight': torch.randn(4, 4),
    'bbox_pred.weight': torch.randn(5, 4),  # 5 outputs (1 bg + 4 classes), will be sliced
    'mask_head.predictor.weight': torch.randn(2, 4),  # Will be sliced
    'fc6.weight': torch.randn(4, 8),
    'fc7.weight': torch.randn(4, 4),
}

ARGS = {
    'weights': weights,
    'add_backbone_prefix': False,
    'use_whole_clip': False,
    'use_fpn_arch': False,
    'regionclip': 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 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
align_and_update_state_dicts Not yet run
unverified (harvested, no recorded run)
Therock90421/DA-Pro/detectron2/checkpoint/c2_model_loading.py
code served (permissive licence) · get_code("ac2638463572c152")
How it ran

no invocation recorded.

align_and_update_state_dicts_for_CLIP Not yet run
unverified (harvested, no recorded run)
Therock90421/DA-Pro/detectron2/checkpoint/clip_model_loading.py
code served (permissive licence) · get_code("0bd7b0a60b4069f9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 1 the same month, 6 later) and 0 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
convert_basic_c2_names 45 other papers
30 dated earlier, 1 the same month, 12 later, 2 same year, order not determinable
1703.06870 (2017-03)
Mask R-CNN
1804.08864 (2018-04)
Learning to See the Invisible: End-to-End Trainable Amodal Instance Segmentation
1901.08164 (2019-01)
Decoupled Greedy Learning of CNNs
and 42 more not named here
align_and_update_state_dicts 13 other papers
5 dated earlier, 7 later, 1 same year, order not determinable
1912.08193 (2019-12)
PointRend: Image Segmentation as Rendering
2211.09808 (2022-11)
Uni-Perceiver v2: A Generalist Model for Large-Scale Vision and Vision-Language Tasks
and 10 more not named here
convert_c2_detectron_names 13 other papers
5 dated earlier, 7 later, 1 same year, order not determinable
1912.08193 (2019-12)
PointRend: Image Segmentation as Rendering
2211.09808 (2022-11)
Uni-Perceiver v2: A Generalist Model for Large-Scale Vision and Vision-Language Tasks
and 10 more not named here
align_and_update_state_dicts_for_CLIP 5 other papers
1 dated earlier, 4 later
Zhong_RegionCLIP_Region-Based_Language-Image_Pretraining_CVPR_2022_paper (2022 (year only))
RegionCLIP: Region-based Language-Image Pretraining
2309.12969 (2023-09)
Detect Everything with Few Examples
2402.03094 (2024-02)
Cross-Domain Few-Shot Object Detection via Enhanced Open-Set Object Detector
and 2 more not named here
convert_basic_clip_names 5 other papers
1 dated earlier, 4 later
Zhong_RegionCLIP_Region-Based_Language-Image_Pretraining_CVPR_2022_paper (2022 (year only))
RegionCLIP: Region-based Language-Image Pretraining
2309.12969 (2023-09)
Detect Everything with Few Examples
2402.03094 (2024-02)
Cross-Domain Few-Shot Object Detection via Enhanced Open-Set Object Detector
and 2 more not named here
convert_clip_names 5 other papers
1 dated earlier, 4 later
Zhong_RegionCLIP_Region-Based_Language-Image_Pretraining_CVPR_2022_paper (2022 (year only))
RegionCLIP: Region-based Language-Image Pretraining
2309.12969 (2023-09)
Detect Everything with Few Examples
2402.03094 (2024-02)
Cross-Domain Few-Shot Object Detection via Enhanced Open-Set Object Detector
and 2 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-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

Domain adaptive object detection (DAOD) aims to generalize detectors trained on an annotated source domain to an unlabelled target domain. However, existing methods focus on reducing the domain bias of the detection backbone by inferring a discriminative visual encoder, while ignoring the domain bias in the detection head. Inspired by the high generalization of vision-language models (VLMs), applying a VLM as the robust detection backbone following a domain-aware detection head is a reasonable way to learn the discriminative detector for each domain, rather than reducing the domain bias in traditional methods. To achieve the above issue, we thus propose a novel DAOD framework named Domain-Aware detection head with Prompt tuning (DA-Pro), which applies the learnable domain-adaptive prompt to generate the dynamic detection head for each domain. Formally, the domainadaptive prompt consists of the domain-invariant tokens, domain-specific tokens, and the domain-related textual description along with the class label. Furthermore, two constraints between the source and target domains are applied to ensure that the domain-adaptive prompt can capture the domains-shared and domain-specific knowledge. A prompt ensemble strategy is also proposed to reduce the effect of prompt disturbance. Comprehensive experiments over multiple cross-domain adaptation tasks demonstrate that using the domain-adaptive prompt can produce an effectively domain-related detection head for boosting domain-adaptive object detection. Our code is available at https://github.com/Therock90421/DA-Pro.

For agents

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

get_harvested_code_for_paper("2306.05718")
get_code_for_paper("2306.05718")
have("2306.05718")

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

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

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

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

Connect an agent — have() is free.