SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1711.02512 · 2017

Fine-tuning CNN Image Retrieval with No Human Annotation

arXiv · PDF · Open in the Atlas

Code that ran

17 of 24 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, 0 violated it and 4 have no contract verdict; 11 failures of our instrument; 7 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/1711.02512.json · badge: /api/ran/1711.02512.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
filipradenovic/cnnimageretrieval-pytorch canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
nikosefth/freedom community (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
raojay7/cnnimageretrieval-pytorch community (classifier label)
classifier basis: plan_row
4 ran · 1 no recorded run
RuibinMa/comp755project-ruibinma reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 2 no recorded run
FunctionStatusWhere it lives
calculate_rankings Ran
ran; our contract draft was wrong, not the code
nikosefth/freedom/utils_retrieval.py
code served (permissive licence) · get_code("2c4e0f8cfef1ae02")
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 int, shape (2, 5) 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
from unittest.mock import MagicMock

torch.manual_seed(0)

# Stand-in model class
class StandInModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Stand-in tokenizer class
class StandInTokenizer:
    def __call__(self, texts, **kwargs):
        return {"input_ids": torch.zeros(len(texts), 8, dtype=torch.long)}

# Stand-in args class
class Args:
    def __init__(self):
        self.method = 'image'
        self.device = 'cpu'
        self.backbone = 'resnet50'
        self.kappa = 3
        self.ni = 2
        self.miu = 2

# Create instances
args = Args()
model = StandInModel()
tokenizer = StandInTokenizer()

# Create feature tensors (batch=2, dim=4)
image_features = torch.randn(2, 4)
text_features = torch.randn(2, 4)
database_features = torch.randn(5, 4)

# Real text list
real_text = ['cat', 'dog']

ARGS = {
    'args': args,
    'model': model,
    'tokenizer': tokenizer,
    'image_features': image_features,
    'text_features': text_features,
    'real_text': real_text,
    'database_features': database_features
}
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 Tensor, ndim 2, dtype family int, shape (2, 5) — shape (2, 5) 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
cid2filename Ran
ran; our contract draft was wrong, not the code
filipradenovic/cnnimageretrieval-pytorch/cirtorch/datasets/datahelpers.py
code served (permissive licence) · get_code("242b9d747b7506cc")
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

ARGS = {
    "cid": "abcdef1234567890",
    "prefix": "/tmp/training_images"
}
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
compute_ap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
raojay7/cnnimageretrieval-pytorch/cirtorch/utils/evaluate.py
code served (permissive licence) · get_code("a07ad22c46aa3105")
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 float64, ndim 0, 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 as np

# Create sample data for compute_ap
# ranks: zero-based ranks of positive images (should be a numpy array or list of integers)
# nres: number of positive images (should be an integer)

ranks = np.array([0, 2, 5, 8])  # Example ranks of positive images
nres = 4  # Number of positive images

ARGS = {
    "ranks": ranks,
    "nres": nres,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
config_imname Ran
ran; our contract draft was wrong, not the code
raojay7/cnnimageretrieval-pytorch/cirtorch/datasets/testdataset.py
pointer only (licence: MIT); the stored copy get_code serves, from mahmoodlab/HIPT, is pointer only (licence: NOASSERTION) · get_code("49cf1f4ce52e9613")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mahmoodlab/HIPT, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

config_qimname Ran
ran; our contract draft was wrong, not the code
raojay7/cnnimageretrieval-pytorch/cirtorch/datasets/testdataset.py
pointer only (licence: MIT); the stored copy get_code serves, from mahmoodlab/HIPT, is pointer only (licence: NOASSERTION) · get_code("91c5ae2396603107")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mahmoodlab/HIPT, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

configdataset Ran
ran on a synthesized input
filipradenovic/cnnimageretrieval-pytorch/cirtorch/datasets/testdataset.py
code served (permissive licence) · get_code("0de66b45ecd14bcb")
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 os
import pickle
import tempfile

# Create a temporary directory structure with mock data
tmpdir = tempfile.mkdtemp()
dataset_name = 'oxford5k'
dataset_dir = os.path.join(tmpdir, dataset_name)
os.makedirs(dataset_dir)
jpg_dir = os.path.join(dataset_dir, 'jpg')
os.makedirs(jpg_dir)

# Create a mock ground truth pickle file
mock_cfg = {
    'imlist': ['img_001', 'img_002', 'img_003'],
    'qimlist': ['query_001', 'query_002'],
}

gnd_fname = os.path.join(dataset_dir, f'gnd_{dataset_name}.pkl')
with open(gnd_fname, 'wb') as f:
    pickle.dump(mock_cfg, f)

ARGS = {
    'dataset': 'oxford5k',
    'dir_main': tmpdir,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
configdataset Ran
ran; our contract draft was wrong, not the code
raojay7/cnnimageretrieval-pytorch/cirtorch/datasets/testdataset.py
code served (permissive licence) · get_code("573436a0c32c7255")
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 os
import pickle
import tempfile
import shutil

# Create a temporary directory structure for the test
temp_dir = tempfile.mkdtemp()
dataset_name = 'oxford5k'
dataset_dir = os.path.join(temp_dir, dataset_name)
jpg_dir = os.path.join(dataset_dir, 'jpg')
os.makedirs(jpg_dir, exist_ok=True)

# Create mock ground truth pickle file
cfg_data = {
    'imlist': ['img1', 'img2', 'img3'],
    'qimlist': ['query1', 'query2'],
}

gnd_file = os.path.join(dataset_dir, f'gnd_{dataset_name}.pkl')
with open(gnd_file, 'wb') as f:
    pickle.dump(cfg_data, f)

# Create dummy image files
for img in cfg_data['imlist']:
    open(os.path.join(jpg_dir, f'{img}.jpg'), 'w').close()
for img in cfg_data['qimlist']:
    open(os.path.join(jpg_dir, f'{img}.jpg'), 'w').close()

ARGS = {
    'dataset': 'oxford5k',
    'dir_main': temp_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 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
extract_ss Ran
ran on a synthesized input
filipradenovic/cnnimageretrieval-pytorch/cirtorch/networks/imageretrievalnet.py
code served (permissive licence) · get_code("45136331921829ac")
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, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Build a minimal nn.Module that can be called with input and returns a tensor
class SimpleNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create instances
net = SimpleNet()
input_tensor = torch.randn(2, 4)

ARGS = {
    'net': net,
    'input': input_tensor
}
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, 3) — shape (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
gem Ran
ran; our contract draft was wrong, not the code
filipradenovic/cnnimageretrieval-pytorch/cirtorch/layers/functional.py
code served (permissive licence) · get_code("ad695e1e64bd704c")
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) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 1, 1) 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.functional as F

torch.manual_seed(0)

# The gem function expects:
# - x: a 4D tensor (batch, channels, height, width) for avg_pool2d
# - p: a numeric parameter (default 3)
# - eps: a small epsilon value (default 1e-06)

# Create a small 4D tensor: batch=2, channels=4, height=3, width=5
x = torch.randn(2, 4, 3, 5)

# p is the power parameter
p = 3

# eps is the epsilon for clamping
eps = 1e-06

ARGS = {
    "x": x,
    "p": p,
    "eps": eps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
mac Ran
ran on a synthesized input
filipradenovic/cnnimageretrieval-pytorch/cirtorch/layers/functional.py
code served (permissive licence) · get_code("d57f881947d223c7")
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 4, dtype family float, shape (2, 4, 1, 1) 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.functional as F

torch.manual_seed(0)

# Create a small 4D tensor suitable for max_pool2d
# Shape: (batch=2, channels=4, height=3, width=5)
x = torch.randn(2, 4, 3, 5)

ARGS = {
    'x': x
}
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 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
pil_loader Ran
ran, honoured the contract we drafted
filipradenovic/cnnimageretrieval-pytorch/cirtorch/datasets/datahelpers.py
code served (permissive licence) · get_code("f321f54723433661")
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) and returned Image. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from PIL import Image
import io
import os
import tempfile

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a simple RGB image and save it to a temporary file
img = Image.new('RGB', (10, 10), color=(73, 109, 137))
test_image_path = os.path.join(temp_dir, 'test_image.jpg')
img.save(test_image_path)

ARGS = {
    'path': test_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
prepare_dataset Ran
ran; our contract draft was wrong, not the code
nikosefth/freedom/utils_retrieval.py
code served (permissive licence) · get_code("4da573acef3a31a2")
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
import os
from unittest.mock import Mock, patch

torch.manual_seed(0)

# Create mock functions that the prepare_dataset function calls
def read_dataset_features(path, device):
    """Mock function to read dataset features"""
    return {
        'features': torch.randn(2, 4),
        'labels': torch.tensor([0, 1]),
        'domains': np.array(['real', 'cartoon', 'real', 'cartoon'])
    }

def replace_domain_names(domains, domain_change):
    """Mock function to replace domain names"""
    return np.array([domain_change.get(d, d) for d in domains])

# Patch the functions in the module
import sys
current_module = sys.modules[__name__]
current_module.read_dataset_features = read_dataset_features
current_module.replace_domain_names = replace_domain_names

# Create args object with all required attributes
class Args:
    def __init__(self):
        self.dataset = 'imagenet_r'
        self.backbone = 'resnet50'
        self.device = 'cpu'
        self.source = None
        self.target = None

ARGS = {
    'args': Args()
}
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
read_corpus_features Ran
ran; our contract draft was wrong, not the code
nikosefth/freedom/utils_features.py
code served (permissive licence) · get_code("dd5302cc60db6a97")
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 pickle
import numpy as np
import torch
import tempfile
import os

torch.manual_seed(0)

# Create a temporary pickle file with the expected structure
temp_dir = tempfile.mkdtemp()
pickle_file = os.path.join(temp_dir, "corpus_features.pkl")

# Create sample data matching what the function expects
data_dict = {
    'feats': np.random.randn(2, 4).astype('float32'),  # 2 samples, 4 features
    'prompts': np.array(['prompt_1', 'prompt_2'])
}

# Write to pickle file
with open(pickle_file, 'wb') as f:
    pickle.dump(data_dict, f)

# Define ARGS
ARGS = {
    'pickle_dir': pickle_file,
    'device': 'cpu'
}
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 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
read_dataset_features Ran
ran; our contract draft was wrong, not the code
nikosefth/freedom/utils_features.py
code served (permissive licence) · get_code("29c92368e3c825e3")
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 pickle
import torch
import numpy as np
import tempfile
import os

torch.manual_seed(0)

# Create a temporary directory and pickle file with sample data
temp_dir = tempfile.mkdtemp()
pickle_path = os.path.join(temp_dir, "test_data.pkl")

# Create sample data with the expected structure
sample_data = {
    'feats': np.random.randn(2, 4).astype('float32'),
    'labels': np.array([0, 1])
}

# Write the pickle file
with open(pickle_path, 'wb') as f:
    pickle.dump(sample_data, f)

# Define ARGS
ARGS = {
    'pickle_dir': pickle_path,
    'device': torch.device('cpu')
}
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
setup_device Ran
ran; our contract draft was wrong, not the code
nikosefth/freedom/utils.py
code served (permissive licence) · get_code("777f1dfa3b9a30cc")
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 device. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type 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)

ARGS = {
    'gpu_id': 0
}
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 device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device 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
spoc Ran
ran on a synthesized input
filipradenovic/cnnimageretrieval-pytorch/cirtorch/layers/functional.py
code served (permissive licence) · get_code("40aedf01731c3391")
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 4, dtype family float, shape (2, 4, 1, 1) 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.functional as F

torch.manual_seed(0)

# x is a 4D tensor (batch, channels, height, width)
# The function calls x.size(-2) and x.size(-1) to get height and width
# Then applies avg_pool2d with kernel size (height, width)
# This performs global average pooling
x = torch.randn(2, 4, 3, 5)

ARGS = {
    'x': x
}
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 4, dtype family float, shape (2, 4, 1, 1) — shape (2, 4, 1, 1) 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
text_list_to_features Ran
ran, honoured the contract we drafted
nikosefth/freedom/utils.py
code served (permissive licence) · get_code("f25d297c260dff44")
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)

class StandInTokenizer:
    def __init__(self, context_length=77):
        self.context_length = context_length
    
    def __call__(self, batch, context_length=77):
        # Return a tensor of token indices
        # batch is a list of strings
        batch_size = len(batch)
        return torch.randint(0, 1000, (batch_size, context_length))

class StandInModel(nn.Module):
    def __init__(self, context_length=77, feature_dim=4):
        super().__init__()
        self.context_length = context_length
        self.feature_dim = feature_dim
        self.linear = nn.Linear(context_length, feature_dim)
    
    def encode_text(self, text_tokens):
        # text_tokens shape: (batch_size, context_length)
        # Return text features of shape (batch_size, feature_dim)
        return self.linear(text_tokens.float())

model = StandInModel(context_length=77, feature_dim=4)
tokenizer = StandInTokenizer(context_length=77)
text_list = ["hello world", "foo bar"]
device = "cpu"
batch_size = 1

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "text_list": text_list,
    "device": device,
    "batch_size": batch_size
}
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
accimage_loader Not yet run
unverified (harvested, no recorded run)
filipradenovic/cnnimageretrieval-pytorch/cirtorch/datasets/datahelpers.py
pointer only (licence: MIT); the stored copy get_code serves, from RobustBench/robustbench, is pointer only (licence: NOASSERTION) · get_code("404fb2b2daa1ae78")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from RobustBench/robustbench, and GitHub could not classify the licence of that repository (NOASSERTION). 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. No invocation recorded.

compute_map Not yet run
unverified (harvested, no recorded run)
filipradenovic/cnnimageretrieval-pytorch/cirtorch/utils/evaluate.py
code served (permissive licence) · get_code("9456f5818ed5a150")
How it ran

no invocation recorded.

compute_map Not yet run
unverified (harvested, no recorded run)
raojay7/cnnimageretrieval-pytorch/cirtorch/utils/evaluate.py
code served (permissive licence) · get_code("263a271470139cb0")
How it ran

no invocation recorded.

get_word_indices Not yet run
unverified (harvested, no recorded run)
nikosefth/freedom/utils.py
code served (permissive licence) · get_code("5d4f354290316732")
How it ran

no invocation recorded.

metrics_calc Not yet run
unverified (harvested, no recorded run)
nikosefth/freedom/utils_retrieval.py
code served (permissive licence) · get_code("4e43c182191e355c")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
RuibinMa/comp755project-ruibinma/cirtorch/examples/train_colon.py
pointer only (licence: NONE) · get_code("c46a359503f53583")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, RuibinMa/comp755project-ruibinma 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. No invocation recorded.

validate Not yet run
unverified (harvested, no recorded run)
RuibinMa/comp755project-ruibinma/cirtorch/examples/train_colon.py
pointer only (licence: NONE) · get_code("fab22d2d060c94a4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, RuibinMa/comp755project-ruibinma 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. No invocation recorded.

Also present in other papers' code

Of 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 12 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 10 later) and 11 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
pil_loader 66 other papers
2 dated earlier, 64 later
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
1902.09212 (2019-02)
Deep High-Resolution Representation Learning for Human Pose Estimation
and 63 more not named here
accimage_loader 39 other papers
1 dated earlier, 38 later
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1805.00907 (2018-05)
Glow: Graph Lowering Compiler Techniques for Neural Networks
1907.02665 (2019-07)
Blind Image Quality Assessment Using A Deep Bilinear Convolutional Neural Network
and 36 more not named here
gem 7 other papers
7 later
1901.10332 (2019-01)
Who's Afraid of Adversarial Queries? The Impact of Image Modifications on Content-based Image Retrieval
2001.08972 (2020-01)
SOLAR: Second-Order Loss and Attention for Image Retrieval
2107.07728 (2021-07)
Recognizing bird species in diverse soundscapes under weak supervision
and 4 more not named here
config_imname 4 other papers
4 later
2106.09681 (2021-06)
XCiT: Cross-Covariance Image Transformers
2109.13228 (2021-09)
PASS: An ImageNet replacement for self-supervised pretraining without humans
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
and 1 more not named here
config_qimname 4 other papers
4 later
2106.09681 (2021-06)
XCiT: Cross-Covariance Image Transformers
2109.13228 (2021-09)
PASS: An ImageNet replacement for self-supervised pretraining without humans
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
and 1 more not named here
compute_ap 2 other papers
2 later
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
2309.05438 (2023-09)
Towards Content-based Pixel Retrieval in Revisited Oxford and Paris
compute_map 2 other papers
2 later
2308.04008 (2023-08)
Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval
2309.05438 (2023-09)
Towards Content-based Pixel Retrieval in Revisited Oxford and Paris
mac 2 other papers
2 later
2001.08972 (2020-01)
SOLAR: Second-Order Loss and Attention for Image Retrieval
2203.01851 (2022-03)
STUN: Self-Teaching Uncertainty Estimation for Place Recognition
spoc 2 other papers
2 later
2001.08972 (2020-01)
SOLAR: Second-Order Loss and Attention for Image Retrieval
2203.01851 (2022-03)
STUN: Self-Teaching Uncertainty Estimation for Place Recognition
cid2filename 1 other paper
1 later
2001.08972 (2020-01)
SOLAR: Second-Order Loss and Attention for Image Retrieval
train 1 other paper
1 dated earlier
1604.02426 (2016-04)
CNN Image Retrieval Learns from BoW: Unsupervised Fine-Tuning with Hard Examples
validate 1 other paper
1 dated earlier
1604.02426 (2016-04)
CNN Image Retrieval Learns from BoW: Unsupervised Fine-Tuning with Hard Examples

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 descriptors based on activations of Convolutional Neural Networks (CNNs) have become dominant in image retrieval due to their discriminative power, compactness of representation, and search efficiency. Training of CNNs, either from scratch or fine-tuning, requires a large amount of annotated data, where a high quality of annotation is often crucial. In this work, we propose to fine-tune CNNs for image retrieval on a large collection of unordered images in a fully automated manner. Reconstructed 3D models obtained by the state-of-the-art retrieval and structure-from-motion methods guide the selection of the training data. We show that both hard-positive and hard-negative examples, selected by exploiting the geometry and the camera positions available from the 3D models, enhance the performance of particular-object retrieval. CNN descriptor whitening discriminatively learned from the same training data outperforms commonly used PCA whitening. We propose a novel trainable Generalized-Mean (GeM) pooling layer that generalizes max and average pooling and show that it boosts retrieval performance. Applying the proposed method to the VGG network achieves state-of-the-art performance on the standard benchmarks: Oxford Buildings, Paris, and Holidays datasets.

For agents

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

get_harvested_code_for_paper("1711.02512")
get_code_for_paper("1711.02512")
have("1711.02512")

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

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

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

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

Connect an agent — have() is free.