SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.02927 · ICCV · 2021

DOLG: Single-Stage Image Retrieval with Deep Orthogonal Fusion of Local and Global Features

Errui Ding, Fu Li, Min Yang, Jizhou Huang, Dongliang He, Miao Fan, Baorong Shi, Xuetong Xue

arXiv · PDF · Open in the Atlas

Code that ran

17 of 23 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 10 have no contract verdict; 7 failures of our instrument; 6 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/2108.02927.json · badge: /api/ran/2108.02927.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
feymanpriv/DOLG canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
Shiro-LK/python-DOLG community (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
innat/DOLG-TensorFlow community
Papers with Code archive
4 ran · 1 no recorded run
FunctionStatusWhere it lives
DOLGLocalBranch Ran
ran on a synthesized input
innat/DOLG-TensorFlow/models/DOLG.py
code served (permissive licence) · get_code("0e1735ffbfaaabee")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned EagerTensor, ndim 4, 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 tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np

# Set seeds for reproducibility
tf.random.set_seed(42)
np.random.seed(42)

# Define the MultiAtrous class
class MultiAtrous(keras.Model):

    def __init__(self, dilation_rates=[6, 12, 18], upsampling=1, kernel_size=3, padding='same', **kwargs):
        super(MultiAtrous, self).__init__(name='MultiAtrous', **kwargs)
        self.dilation_rates = dilation_rates
        self.kernel_size = kernel_size
        self.upsampling = upsampling
        self.padding = padding
        self.dilated_convs = [layers.Conv2D(filters=int(1024 / 4), kernel_size=self.kernel_size, padding=self.padding, dilation_rate=rate) for rate in self.dilation_rates]
        self.gap_branch = keras.Sequential([layers.GlobalAveragePooling2D(keepdims=True), layers.Conv2D(int(1024 / 2), kernel_size=1), layers.Activation('relu'), layers.UpSampling2D(size=self.upsampling, interpolation='bilinear')], name='gap_branch')

    def call(self, inputs, training=None, **kwargs):
        local_feature = []
        for dilated_conv in self.dilated_convs:
            x = dilated_conv(inputs)
            x = self.gap_branch(x)
            local_feature.append(x)
        return tf.concat(local_feature, axis=-1)

    def get_config(self):
        config = {'dilation_rates': self.dilation_rates, 'kernel_size': self.kernel_size, 'padding': self.padding, 'upsampling': self.upsampling}
        base_config = super(MultiAtrous, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))

# Define the DOLGLocalBranch class
class DOLGLocalBranch(keras.Model):

    def __init__(self, IMG_SIZE, **kwargs):
        super(DOLGLocalBranch, self).__init__(name='LocalBranch', **kwargs)
        self.multi_atrous = MultiAtrous(padding='same', upsampling=int(IMG_SIZE / 32))
        self.conv1 = layers.Conv2D(1024, kernel_size=1)
        self.conv2 = layers.Conv2D(1024, kernel_size=1, use_bias=False)
        self.conv3 = layers.Conv2D(1024, kernel_size=1)
        self.bn = layers.BatchNormalization()

    def call(self, inputs, training=None, **kwargs):
        local_feat = self.multi_atrous(inputs)
        local_feat = self.conv1(local_feat)
        local_feat = tf.nn.relu(local_feat)
        local_feat = self.conv2(local_feat)
        local_feat = self.bn(local_feat)
        norm_local_feat = tf.math.l2_normalize(local_feat)
        attn_map = tf.nn.relu(local_feat)
        attn_map = self.conv3(attn_map)
        attn_map = keras.activations.softplus(attn_map)
        return norm_local_feat * attn_map

# Setup code
INIT_ARGS = {
    'IMG_SIZE': 64
}

# Create input tensor: batch_size=2, height=64, width=64, channels=3
inputs = tf.random.normal((2, 64, 64, 3))

ARGS = {
    'inputs': inputs,
    'training': False
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GeneralizedMeanPooling2D Ran
ran on a synthesized input
innat/DOLG-TensorFlow/models/DOLG.py
code served (permissive licence) · get_code("eb1f7279fa17703b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned EagerTensor, ndim 2, dtype family float, shape (2, 8) 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 tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers

class GeneralizedMeanPooling2D(layers.Layer):

    def __init__(self, init_norm=3.0, normalize=False, epsilon=1e-06, **kwargs):
        self.init_norm = init_norm
        self.normalize = normalize
        self.epsilon = epsilon
        super(GeneralizedMeanPooling2D, self).__init__(**kwargs)

    def build(self, input_shape):
        self.p = self.add_weight(name='norms', shape=(input_shape[-1],), initializer=keras.initializers.constant(self.init_norm), trainable=True)
        super(GeneralizedMeanPooling2D, self).build(input_shape)

    def call(self, inputs):
        x = tf.abs(tf.maximum(self.epsilon, inputs))
        x = tf.pow(x, self.p)
        x = tf.reduce_mean(x, axis=[1, 2], keepdims=False)
        x = tf.pow(x, 1.0 / self.p)
        if self.normalize:
            x = tf.nn.l2_normalize(x, 1)
        return x

    def get_config(self):
        config = {'init_norm': self.init_norm, 'normalize': self.normalize, 'epsilon': self.epsilon}
        base_config = super(GeneralizedMeanPooling2D, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))


INIT_ARGS = {
    'init_norm': 3.0,
    'normalize': False,
    'epsilon': 1e-06
}

ARGS = {
    'inputs': tf.random.normal((2, 4, 3, 8))
}

if __name__ == '__main__':
    layer = GeneralizedMeanPooling2D(**INIT_ARGS)
    output = layer(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 8) — shape (2, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MultiAtrous Ran
ran on a synthesized input
innat/DOLG-TensorFlow/models/DOLG.py
code served (permissive licence) · get_code("6b3acd9aecd4def9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned EagerTensor, ndim 4, 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 tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers

INIT_ARGS = {
    'dilation_rates': [6, 12, 18],
    'upsampling': 1,
    'kernel_size': 3,
    'padding': 'same',
}

ARGS = {
    'inputs': tf.random.normal((2, 8, 8, 256)),
}

class MultiAtrous(keras.Model):

    def __init__(self, dilation_rates=[6, 12, 18], upsampling=1, kernel_size=3, padding='same', **kwargs):
        super(MultiAtrous, self).__init__(name='MultiAtrous', **kwargs)
        self.dilation_rates = dilation_rates
        self.kernel_size = kernel_size
        self.upsampling = upsampling
        self.padding = padding
        self.dilated_convs = [layers.Conv2D(filters=int(1024 / 4), kernel_size=self.kernel_size, padding=self.padding, dilation_rate=rate) for rate in self.dilation_rates]
        self.gap_branch = keras.Sequential([layers.GlobalAveragePooling2D(keepdims=True), layers.Conv2D(int(1024 / 2), kernel_size=1), layers.Activation('relu'), layers.UpSampling2D(size=self.upsampling, interpolation='bilinear')], name='gap_branch')

    def call(self, inputs, training=None, **kwargs):
        local_feature = []
        for dilated_conv in self.dilated_convs:
            x = dilated_conv(inputs)
            x = self.gap_branch(x)
            local_feature.append(x)
        return tf.concat(local_feature, axis=-1)

    def get_config(self):
        config = {'dilation_rates': self.dilation_rates, 'kernel_size': self.kernel_size, 'padding': self.padding, 'upsampling': self.upsampling}
        base_config = super(MultiAtrous, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))


if __name__ == '__main__':
    model = MultiAtrous(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output dtype: {output.dtype}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
OrthogonalFusion Ran
ran on a synthesized input
innat/DOLG-TensorFlow/models/DOLG.py
code served (permissive licence) · get_code("399f81dfa6feffde")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned EagerTensor, ndim 4, 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 tensorflow as tf
from tensorflow.keras import layers

class OrthogonalFusion(layers.Layer):

    def __init__(self, **kwargs):
        super().__init__(name='OrthogonalFusion', **kwargs)

    def call(self, inputs):
        local_feat, global_feat = inputs
        height = local_feat.shape[1]
        width = local_feat.shape[2]
        depth = local_feat.shape[3]
        local_feat = tf.reshape(local_feat, [-1, height * width, depth])
        local_feat = tf.transpose(local_feat, perm=[0, 2, 1])
        projection = tf.matmul(tf.expand_dims(global_feat, axis=1), local_feat)
        projection = tf.matmul(tf.expand_dims(global_feat, axis=2), projection)
        projection = tf.reshape(projection, [-1, height, width, depth])
        global_feat_norm = tf.norm(global_feat, ord=2, axis=1)
        projection = projection / tf.reshape(global_feat_norm * global_feat_norm, shape=[-1, 1, 1, 1])
        local_feat = tf.transpose(local_feat, perm=[0, 1, 2])
        local_feat = tf.reshape(local_feat, [-1, height, width, depth])
        orthogonal_comp = local_feat - projection
        global_feat = tf.expand_dims(tf.expand_dims(global_feat, axis=1), axis=1)
        global_feat = tf.broadcast_to(global_feat, tf.shape(local_feat))
        output = tf.concat([global_feat, orthogonal_comp], axis=-1)
        return output


INIT_ARGS = {}

ARGS = {
    'inputs': [
        tf.random.normal([2, 4, 3, 8]),
        tf.random.normal([2, 8])
    ]
}

if __name__ == '__main__':
    layer = OrthogonalFusion(**INIT_ARGS)
    output = layer(ARGS['inputs'])
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
adaptative_avg_pool2d Ran
ran on a synthesized input
Shiro-LK/python-DOLG/dolg/resnet_tf2.py
code served (permissive licence) · get_code("0ebf59946affa912")
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 EagerTensor, ndim 4, dtype family float, shape (2, 2, 2, 3) 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 tensorflow as tf
import numpy as np

# Create a small test input tensor
# Shape: (batch=2, height=8, width=6, channels=3)
x = tf.constant(np.random.randn(2, 8, 6, 3).astype(np.float32))

# Define output_dim as an integer
output_dim = 2

ARGS = {
    "x": x,
    "output_dim": output_dim,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 2, 2, 3) — shape (2, 2, 2, 3) 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
cache_url Ran
ran; our contract draft was wrong, not the code
feymanpriv/DOLG/core/io.py
code served (permissive licence) · get_code("f623b3e3625d4e42")
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 str. 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 os
import tempfile
import re

# Create a temporary directory to use as cache_dir
cache_dir = tempfile.mkdtemp()

# Test case 1: local file path (not a URL)
local_file_path = "/path/to/local/file.txt"

# Test case 2: URL that matches the pycls base URL pattern
# We'll use a valid-looking URL but won't actually try to download
pycls_url = "https://dl.fbaipublicfiles.com/pycls/models/model.pth"

# For testing purposes, we'll use a local file path since downloading is not allowed
url_or_file = local_file_path

ARGS = {
    "url_or_file": url_or_file,
    "cache_dir": cache_dir
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
complexity_batchnorm2d Ran
ran; our contract draft was wrong, not the code
feymanpriv/DOLG/core/net.py
code served (permissive licence) · get_code("4136b6e9df422178")
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 torch.nn as nn

torch.manual_seed(0)

# The function expects:
# - cx: a dict with keys 'h', 'w', 'flops', 'params', 'acts'
# - w_in: an integer representing input width/channels

# Construct the cx dict with all required keys
cx = {
    'h': 32,           # height dimension
    'w': 64,           # width dimension
    'flops': 1000,     # floating point operations
    'params': 500,     # number of parameters
    'acts': 2048       # number of activations
}

# w_in is the input width/channels for BatchNorm2D
w_in = 16

ARGS = {
    'cx': cx,
    'w_in': w_in
}
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
complexity_conv2d Ran
ran; our contract draft was wrong, not the code
feymanpriv/DOLG/core/net.py
code served (permissive licence) · get_code("b299737079f619a1")
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

torch.manual_seed(0)

# Construct a valid complexity state dictionary
cx = {
    'h': 32,           # height
    'w': 32,           # width
    'flops': 0,        # floating point operations
    'params': 0,       # parameters
    'acts': 0          # activations
}

# Conv2D parameters
w_in = 3             # input channels
w_out = 64           # output channels
k = 3                # kernel size
stride = 1           # stride
padding = 1          # padding
groups = 1           # groups (default)
bias = False         # bias (default)

ARGS = {
    'cx': cx,
    'w_in': w_in,
    'w_out': w_out,
    'k': k,
    'stride': stride,
    'padding': padding,
    'groups': groups,
    'bias': bias
}
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
complexity_maxpool2d Ran
ran; our contract draft was wrong, not the code
feymanpriv/DOLG/core/net.py
code served (permissive licence) · get_code("ee4b7c6aef3ebb1f")
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 torch.nn as nn

torch.manual_seed(0)

# Create a valid complexity context dict
cx = {
    'h': 32,
    'w': 32,
    'flops': 1000,
    'params': 100,
    'acts': 500
}

# Define kernel size, stride, and padding for MaxPool2d
k = 2
stride = 2
padding = 0

# Map all parameters to their values
ARGS = {
    'cx': cx,
    'k': k,
    'stride': stride,
    'padding': padding
}
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
dump_log_data Ran
ran on a synthesized input
feymanpriv/DOLG/core/logging.py
code served (permissive licence) · get_code("7defe868d1a6d115")
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 str. 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 decimal
import simplejson
import torch
import numpy as np

_TAG = 'json_stats: '
_TYPE = '_type'

def float_to_decimal(data, prec=4):
    """Convert floats to decimals which allows for fixed width json."""
    if isinstance(data, dict):
        return {k: float_to_decimal(v, prec) for k, v in data.items()}
    if isinstance(data, float):
        return decimal.Decimal(('{:.' + str(prec) + 'f}').format(data))
    else:
        return data

def dump_log_data(data, data_type, prec=4):
    """Covert data (a dictionary) into tagged json string for logging."""
    data[_TYPE] = data_type
    data = float_to_decimal(data, prec)
    data_json = simplejson.dumps(data, sort_keys=True, use_decimal=True)
    return '{:s}{:s}'.format(_TAG, data_json)

torch.manual_seed(0)

ARGS = {
    'data': {
        'loss': 0.5234,
        'accuracy': 0.9876,
        'learning_rate': 0.001,
        'epoch': 42,
        'nested_metric': {
            'train_loss': 0.3456,
            'val_loss': 0.4567
        }
    },
    'data_type': 'training_metrics',
    'prec': 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, simplejson, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
extract_embedding_pt Ran
ran on a synthesized input
Shiro-LK/python-DOLG/dolg/utils/extraction.py
code served (permissive licence) · get_code("b428876a811ea78e")
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 ndarray, ndim 2, dtype family float, shape (1, 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
import numpy as np
import tempfile
import os
import cv2

torch.manual_seed(0)

# Create a temporary directory and a dummy image file
temp_dir = tempfile.mkdtemp()
dummy_image = np.random.randint(0, 256, (512, 512, 3), dtype=np.uint8)
image_path = os.path.join(temp_dir, "test_image.jpg")
cv2.imwrite(image_path, dummy_image)

# Create a minimal model that satisfies the function's usage
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(3 * 512 * 512, 4)
    
    def forward(self, x):
        # x shape: (batch, 3, 512, 512)
        batch_size = x.shape[0]
        x = x.view(batch_size, -1)
        output = self.linear(x)
        return output

model = DummyModel()

ARGS = {
    "filename": "test_image.jpg",
    "root_dir": temp_dir,
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (1, 4) — shape (1, 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
extract_embedding_tf Ran
ran on a synthesized input
Shiro-LK/python-DOLG/dolg/utils/extraction.py
code served (permissive licence) · get_code("447c96f744ac2f44")
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 ndarray, ndim 2, dtype family float, shape (1, 128) 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
import numpy as np
import tempfile
import os
import cv2

# Create a temporary directory and a dummy image file
temp_dir = tempfile.mkdtemp()
dummy_img = np.random.randint(0, 256, (512, 512, 3), dtype=np.uint8)
img_path = os.path.join(temp_dir, "test_image.jpg")
cv2.imwrite(img_path, dummy_img)

# Create a mock TensorFlow model
class MockTFModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(512 * 512 * 3, 128)
    
    def __call__(self, img):
        # Simulate TensorFlow model behavior
        # Input is numpy array, output should be a mock TensorFlow tensor-like object
        batch_size = img.shape[0]
        flat_img = img.reshape(batch_size, -1)
        output = np.random.randn(batch_size, 128).astype(np.float32)
        
        # Return mock TensorFlow tensor with numpy() method
        class MockTensor:
            def __init__(self, data):
                self.data = data
            def numpy(self):
                return self.data
        
        return MockTensor(output)

model = MockTFModel()

ARGS = {
    "filename": "test_image.jpg",
    "root_dir": temp_dir,
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (1, 128) — shape (1, 128) 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
float_to_decimal Ran
ran on a synthesized input
feymanpriv/DOLG/core/logging.py
code served (permissive licence) · get_code("99b17e191b358f21")
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 decimal
import torch

torch.manual_seed(0)

# The function converts floats to decimals recursively
# It handles dicts, floats, and other types
# Parameters: data (can be dict, float, or other), prec (int for precision)

ARGS = {
    "data": {
        "loss": 0.5432,
        "accuracy": 0.9876,
        "nested": {
            "value": 0.1234,
            "other": 42
        }
    },
    "prec": 4
}
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
get_logger Ran
ran; our contract draft was wrong, not the code
feymanpriv/DOLG/core/logging.py
code served (permissive licence) · get_code("8e4e129cb77e7f8b")
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 Logger. 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 logging

ARGS = {
    "name": "test_logger"
}
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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
get_trans_fun Ran
ran; our contract draft was wrong, not the code
Shiro-LK/python-DOLG/dolg/resnet_pt.py
code served (permissive licence) · get_code("2c4de05e1dd24c3b")
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 type. 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)

ARGS = {
    'name': 'bottleneck_transform'
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
process_data Ran
ran on a synthesized input
Shiro-LK/python-DOLG/dolg/utils/extraction.py
code served (permissive licence) · get_code("e2bad3f7809fe40b")
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 (3, 512, 512) 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 numpy as np
import cv2
import tempfile
import os

# Create a temporary directory and a dummy image file
temp_dir = tempfile.mkdtemp()
dummy_img = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
dummy_filename = "test_image.jpg"
cv2.imwrite(os.path.join(temp_dir, dummy_filename), dummy_img)

ARGS = {
    "filename": dummy_filename,
    "root_dir": temp_dir,
    "mode": "pt"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy, 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 3, dtype family float, shape (3, 512, 512) — shape (3, 512, 512) 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
time_string Ran
ran; our contract draft was wrong, not the code
feymanpriv/DOLG/core/meters.py
code served (permissive licence) · get_code("803bcd86e3301891")
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 str. 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)

# Looking at the time_string function:
# - It takes one parameter: seconds
# - It performs divmod operations on an integer version of seconds
# - It formats the result as a string with days, hours, minutes, seconds

ARGS = {
    "seconds": 123456.789
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
DOLGNet Not yet run
unverified (harvested, no recorded run)
innat/DOLG-TensorFlow/models/DOLG.py
code served (permissive licence) · get_code("73d7a43c9d2acecd")
How it ran

no invocation recorded.

assign_globalmodel Not yet run
unverified (harvested, no recorded run)
Shiro-LK/python-DOLG/dolg/utils/convert_pt_to_tf2.py
code served (permissive licence) · get_code("7b02caef473b8b28")
How it ran

no invocation recorded.

assign_localmodel Not yet run
unverified (harvested, no recorded run)
Shiro-LK/python-DOLG/dolg/utils/convert_pt_to_tf2.py
code served (permissive licence) · get_code("0ca3d5ab1b980b50")
How it ran

no invocation recorded.

download_url Not yet run
unverified (harvested, no recorded run)
feymanpriv/DOLG/core/io.py
code served (permissive licence) · get_code("e10bd0e3f25f2b57")
How it ran

no invocation recorded.

get_trans_fun Not yet run
unverified (harvested, no recorded run)
Shiro-LK/python-DOLG/dolg/resnet_tf2.py
code served (permissive licence) · get_code("9796c11dad3f8cd9")
How it ran

no invocation recorded.

topk_errors Not yet run
unverified (harvested, no recorded run)
feymanpriv/DOLG/core/meters.py
code served (permissive licence) · get_code("9fd6e917d49f48e4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 8 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
get_logger 8 other papers
1 dated earlier, 7 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2301.12132 (2023-01)
AutoPEFT: Automatic Configuration Search for Parameter-Efficient Fine-Tuning
2306.02018 (2023-06)
VideoComposer: Compositional Video Synthesis with Motion Controllability
and 5 more not named here
complexity_batchnorm2d 3 other papers
2 dated earlier, 1 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2003.13678 (2020-03)
Designing Network Design Spaces
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
time_string 3 other papers
1 dated earlier, 2 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2209.12892 (2022-09)
Learning to Learn with Generative Models of Neural Network Checkpoints
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
cache_url 2 other papers
1 dated earlier, 1 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
complexity_conv2d 2 other papers
1 dated earlier, 1 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
complexity_maxpool2d 2 other papers
1 dated earlier, 1 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
download_url 2 other papers
1 dated earlier, 1 later
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
get_trans_fun 2 other papers
1 dated earlier, 1 later
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
2308.06954 (2023-08)
Global Features are All You Need for Image Retrieval and Reranking
dump_log_data 1 other paper
1 dated earlier
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition
float_to_decimal 1 other paper
1 dated earlier
1905.13214 (2019-05)
On Network Design Spaces for Visual Recognition

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

Image Retrieval is a fundamental task of obtaining images similar to the query one from a database. A common image retrieval practice is to firstly retrieve candidate images via similarity search using global image features and then re-rank the candidates by leveraging their local features. Previous learning-based studies mainly focus on either global or local image representation learning to tackle the retrieval task. In this paper, we abandon the two-stage paradigm and seek to design an effective singlestage solution by integrating local and global information inside images into compact image representations. Specifically, we propose a Deep Orthogonal Local and Global (DOLG) information fusion framework for end-to-end image retrieval. It attentively extracts representative local information with multi-atrous convolutions and self-attention at first. Components orthogonal to the global image representation are then extracted from the local information. At last, the orthogonal components are concatenated with the global representation as a complementary, and then aggregation is performed to generate the final representation. The whole framework is end-to-end differentiable and can be trained with image-level labels. Extensive experimental results validate the effectiveness of our solution and show that our model achieves state-of-the-art image retrieval performances on Revisited Oxford and Paris datasets. 1

For agents

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

get_harvested_code_for_paper("2108.02927")
get_code_for_paper("2108.02927")
have("2108.02927")

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

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

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

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

Connect an agent — have() is free.