SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1908.01998 · 2019

Few-Shot Object Detection with Attention-RPN and Multi-Relation Detector

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1908.01998.json · badge: /api/ran/1908.01998.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
fanq15/FewX canonical (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
fanq15/FSOD-code community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
get_box_cls_ls Ran
ran on a synthesized input
fanq15/FSOD-code/lib/3_pred_gt_sim_det_fast.py
code served (permissive licence) · get_code("38bddb8fee66fd8b")
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. 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 numpy as np
import random

random.seed(0)

# Create a minimal pkl_ls structure that the function expects
# Each element should be a dict with 'roidb' key containing a numpy array
# roidb should have shape (num_boxes, num_features) where first feature is class id

pkl_ls = [
    {
        'roidb': np.array([
            [0, 1.0, 2.0, 3.0, 4.0],
            [1, 5.0, 6.0, 7.0, 8.0],
            [2, 9.0, 10.0, 11.0, 12.0],
            [3, 13.0, 14.0, 15.0, 16.0],
        ])
    },
    {
        'roidb': np.array([
            [0, 1.0, 2.0, 3.0, 4.0],
            [1, 5.0, 6.0, 7.0, 8.0],
            [4, 9.0, 10.0, 11.0, 12.0],
        ])
    },
    {
        'roidb': np.array([
            [2, 1.0, 2.0, 3.0, 4.0],
            [5, 5.0, 6.0, 7.0, 8.0],
            [10, 9.0, 10.0, 11.0, 12.0],
            [15, 13.0, 14.0, 15.0, 16.0],
            [20, 17.0, 18.0, 19.0, 20.0],
        ])
    }
]

ARGS = {
    'pkl_ls': pkl_ls
}
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 list — a list 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
get_contour_interior Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fanq15/FewX/fewx/layers/boundary.py
code served (permissive licence) · get_code("37048c236eb86341")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family int; 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
from skimage.morphology import remove_small_objects, dilation, erosion, binary_dilation, binary_erosion, square

# Create a small binary mask for testing
# Using a simple 4x5 binary array
mask = np.array([
    [0, 1, 1, 0, 1],
    [1, 1, 1, 1, 0],
    [1, 1, 0, 1, 1],
    [0, 1, 1, 1, 0]
], dtype=np.uint8)

ARGS = {
    "mask": mask,
    "bold": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family int — 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
get_instances_contour_interior Ran
ran, honoured the contract we drafted
fanq15/FewX/fewx/layers/boundary.py
code served (permissive licence) · get_code("9b506f9da113b9eb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

# Create a simple mock object with a .data attribute
class MockInstancesMask:
    def __init__(self, data):
        self.data = data

# Create a small binary mask (4x3 for distinct dimensions)
# This represents an instances mask with some foreground regions
instances_data = np.array([
    [0, 1, 1],
    [1, 1, 0],
    [1, 1, 1],
    [0, 1, 1]
], dtype=np.uint8)

# Wrap it in the mock object that the function expects
instances_mask = MockInstancesMask(instances_data)

ARGS = {
    "instances_mask": instances_mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, skimage, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pkl_ls Ran
ran on a synthesized input
fanq15/FSOD-code/lib/3_pred_gt_sim_det_fast.py
code served (permissive licence) · get_code("c3b291d046f1622d")
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 pickle
import tempfile
import os

# Create a temporary pickle file with sample data
temp_dir = tempfile.mkdtemp()
pkl_path = os.path.join(temp_dir, 'gt.pkl')

# Write some sample objects to the pickle file
with open(pkl_path, 'wb') as f:
    pickle.dump({'data': [1, 2, 3]}, f)
    pickle.dump({'data': [4, 5, 6]}, f)
    pickle.dump({'data': [7, 8, 9]}, f)

ARGS = {
    'pkl_path': pkl_path
}
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
interpolate Ran
ran; our contract draft was wrong, not the code
fanq15/FewX/fewx/layers/misc.py
pointer only (licence: MIT); the stored copy get_code serves, from KanghoonYoon/torch-rasgg, is pointer only (licence: NONE) · get_code("2902bf4410253ff7")
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 KanghoonYoon/torch-rasgg, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

parse_rec Ran
ran; our contract draft was wrong, not the code
fanq15/FSOD-code/lib/datasets/voc_eval.py
code served (permissive licence) · get_code("06e62194f17cd06a")
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 xml.etree.ElementTree as ET
import tempfile
import os

# Create a minimal valid PASCAL VOC XML file
xml_content = """<?xml version="1.0"?>
<annotation>
  <filename>test.jpg</filename>
  <size>
    <width>640</width>
    <height>480</height>
    <depth>3</depth>
  </size>
  <object>
    <name>person</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>10</xmin>
      <ymin>20</ymin>
      <xmax>100</xmax>
      <ymax>150</ymax>
    </bndbox>
  </object>
  <object>
    <name>dog</name>
    <pose>Left</pose>
    <truncated>1</truncated>
    <difficult>1</difficult>
    <bndbox>
      <xmin>200</xmin>
      <ymin>250</ymin>
      <xmax>350</xmax>
      <ymax>400</ymax>
    </bndbox>
  </object>
</annotation>
"""

# Create a temporary XML file
with tempfile.NamedTemporaryFile(mode='w', suffix='.xml', delete=False) as f:
    f.write(xml_content)
    temp_xml_path = f.name

ARGS = {
    'filename': temp_xml_path
}
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
voc_ap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fanq15/FSOD-code/lib/datasets/voc_eval.py
pointer only (licence: MIT); the stored copy get_code serves, from amajee11us/CROWD, is pointer only (licence: NONE) · get_code("611c47c44c424dba")
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 amajee11us/CROWD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

voc_ap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fanq15/FSOD-code/lib/3_pred_gt_sim_det_fast.py
code served (permissive licence) · get_code("f7e098820789174a")
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

# Construct valid arguments for voc_ap function
# The function takes recall and precision arrays and computes average precision

# Create sample recall and precision arrays
# These should be monotonic or realistic values for AP calculation
rec = np.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9])
prec = np.array([0.95, 0.90, 0.85, 0.80, 0.75, 0.70, 0.65, 0.60, 0.55])

ARGS = {
    "rec": rec,
    "prec": prec,
    "use_07_metric": False
}
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
voc_eval Ran
ran on a synthesized input
fanq15/FSOD-code/lib/datasets/voc_eval.py
code served (permissive licence) · get_code("fa2ad31f1f9213e1")
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 numpy as np
import tempfile
import os

# Create temporary directory for detection results
tmpdir = tempfile.mkdtemp()

# Create a sample detection file
classname = "person"
detfile = os.path.join(tmpdir, f"{classname}.txt")
with open(detfile, 'w') as f:
    f.write("img_001 0.95 10 20 50 80\n")
    f.write("img_002 0.85 15 25 55 85\n")
    f.write("img_001 0.75 60 70 100 120\n")

# Create annotation records
recs = {
    "img_001": [
        {"name": "person", "bbox": np.array([10, 20, 50, 80]), "difficult": False},
        {"name": "person", "bbox": np.array([60, 70, 100, 120]), "difficult": False},
        {"name": "car", "bbox": np.array([5, 5, 40, 40]), "difficult": False},
    ],
    "img_002": [
        {"name": "person", "bbox": np.array([15, 25, 55, 85]), "difficult": False},
        {"name": "person", "bbox": np.array([120, 130, 150, 160]), "difficult": True},
    ],
}

imagenames = ["img_001", "img_002"]
annopath = ""  # Not used in the function body since recs is provided
detpath = os.path.join(tmpdir, "{}.txt")
cachedir = tmpdir

ARGS = {
    "detpath": detpath,
    "annopath": annopath,
    "recs": recs,
    "imagenames": imagenames,
    "classname": classname,
    "cachedir": cachedir,
    "ovthresh": 0.5,
    "use_07_metric": False,
}
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 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
get_center Not yet run
unverified (harvested, no recorded run)
fanq15/FewX/fewx/layers/boundary.py
code served (permissive licence) · get_code("dac8413f65a84dfc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 6 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 6 later) and 3 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
interpolate 38 other papers
8 dated earlier, 30 later
1703.06870 (2017-03)
Mask R-CNN
1803.03243 (2018-03)
Domain Adaptive Faster R-CNN for Object Detection in the Wild
1807.08865 (2018-07)
StereoNet: Guided Hierarchical Refinement for Real-Time Edge-Aware Depth Prediction
and 35 more not named here
voc_ap 27 other papers
11 dated earlier, 16 later
1506.01497 (2015-06)
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
1605.06409 (2016-05)
R-FCN: Object Detection via Region-based Fully Convolutional Networks
1609.03605 (2016-09)
Detecting Text in Natural Image with Connectionist Text Proposal Network
and 24 more not named here
parse_rec 14 other papers
7 dated earlier, 7 later
1506.01497 (2015-06)
Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
1605.06409 (2016-05)
R-FCN: Object Detection via Region-based Fully Convolutional Networks
1609.03605 (2016-09)
Detecting Text in Natural Image with Connectionist Text Proposal Network
and 11 more not named here
get_center 3 other papers
3 later
2103.12340 (2021-03)
Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers
136990421 (2022 (year only))
AirDet: Few-Shot Detection without Fine-tuning for Autonomous Exploration
2404.05069 (2024-04)
AirShot: Efficient Few-Shot Detection for Autonomous Exploration
get_contour_interior 3 other papers
3 later
2103.12340 (2021-03)
Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers
136990421 (2022 (year only))
AirDet: Few-Shot Detection without Fine-tuning for Autonomous Exploration
2404.05069 (2024-04)
AirShot: Efficient Few-Shot Detection for Autonomous Exploration
get_instances_contour_interior 3 other papers
3 later
2103.12340 (2021-03)
Deep Occlusion-Aware Instance Segmentation with Overlapping BiLayers
136990421 (2022 (year only))
AirDet: Few-Shot Detection without Fine-tuning for Autonomous Exploration
2404.05069 (2024-04)
AirShot: Efficient Few-Shot Detection for Autonomous Exploration

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Conventional methods for object detection typically require a substantial amount of training data and preparing such high-quality training data is very labor-intensive. In this paper, we propose a novel few-shot object detection network that aims at detecting objects of unseen categories with only a few annotated examples. Central to our method are our Attention-RPN, Multi-Relation Detector and Contrastive Training strategy, which exploit the similarity between the few shot support set and query set to detect novel objects while suppressing false detection in the background. To train our network, we contribute a new dataset that contains 1000 categories of various objects with high-quality annotations. To the best of our knowledge, this is one of the first datasets specifically designed for few-shot object detection. Once our few-shot network is trained, it can detect objects of unseen categories without further training or fine-tuning. Our method is general and has a wide range of potential applications. We produce a new state-of-the-art performance on different datasets in the few-shot setting. The dataset link is https://github.com/fanq15/Few-Shot-Object-Detection-Dataset.

For agents

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

get_harvested_code_for_paper("1908.01998")
get_code_for_paper("1908.01998")
have("1908.01998")

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

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

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

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

Connect an agent — have() is free.