SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1802.08122 · 2018

Harmonious Attention Network for Person Re-Identification

arXiv · PDF · Open in the Atlas

Code that ran

9 of 15 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 8 have no contract verdict; 1 failure of our instrument; 6 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/1802.08122.json · badge: /api/ran/1802.08122.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
milkplz/keras-frcnn community (classifier label)
classifier basis not recorded on the link
9 ran · 6 no recorded run
FunctionStatusWhere it lives
apply_regr Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/roi_helpers.py
code served (permissive licence) · get_code("ec8be8008c975765")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family 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 math

# This function takes 8 scalar parameters: x, y, w, h (bounding box)
# and tx, ty, tw, th (regression targets)
# All parameters are used in arithmetic operations (addition, multiplication, exp, etc.)
# They should be numeric values (int or float)

ARGS = {
    'x': 10,
    'y': 20,
    'w': 100,
    'h': 150,
    'tx': 0.1,
    'ty': 0.05,
    'tw': 0.2,
    'th': -0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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
apply_regr_np Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/roi_helpers.py
code served (permissive licence) · get_code("12ba3e9b0c04e9e4")
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 3, dtype family float, shape (4, 2, 2) 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 numpy as np

# Create small test arrays for X and T
# X contains [x, y, w, h] coordinates and dimensions
# Shape: (4, height, width) where 4 represents the 4 channels
X = np.array([
    [[10.0, 20.0], [30.0, 40.0]],  # x coordinates
    [[15.0, 25.0], [35.0, 45.0]],  # y coordinates
    [[50.0, 60.0], [70.0, 80.0]],  # widths
    [[25.0, 30.0], [35.0, 40.0]]   # heights
], dtype=np.float32)

# T contains regression targets [tx, ty, tw, th]
# Shape: (4, height, width) matching X
T = np.array([
    [[0.1, 0.2], [0.15, 0.25]],    # tx (x regression)
    [[0.05, 0.1], [0.12, 0.18]],   # ty (y regression)
    [[0.2, 0.3], [0.25, 0.35]],    # tw (width regression in log space)
    [[0.15, 0.25], [0.2, 0.3]]     # th (height regression in log space)
], dtype=np.float32)

ARGS = {
    "X": X,
    "T": T
}
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 ndarray, ndim 3, dtype family float, shape (4, 2, 2) — shape (4, 2, 2) 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
augment Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/data_augment.py
code served (permissive licence) · get_code("73efd07b31c131cd")
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 cv2
import numpy as np
import tempfile
import os

# Create a temporary image file for testing
temp_dir = tempfile.mkdtemp()
img_path = os.path.join(temp_dir, "test_image.jpg")

# Create a simple test image (100x80 pixels, 3 channels)
test_img = np.random.randint(0, 256, (80, 100, 3), dtype=np.uint8)
cv2.imwrite(img_path, test_img)

# Create config class with required attributes
class Config:
    def __init__(self):
        self.use_horizontal_flips = True
        self.use_vertical_flips = True
        self.rot_90 = True

# Create img_data dictionary with required fields
img_data = {
    'filepath': img_path,
    'bboxes': [
        {'x1': 10, 'x2': 30, 'y1': 15, 'y2': 50, 'class': 'person'},
        {'x1': 40, 'x2': 70, 'y1': 20, 'y2': 60, 'class': 'car'}
    ],
    'width': 100,
    'height': 80
}

config = Config()

ARGS = {
    'img_data': img_data,
    'config': config,
    'augment': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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_data Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/pascal_voc_parser.py
code served (permissive licence) · get_code("260ceac63872066b")
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 os
import tempfile
import xml.etree.ElementTree as ET

# Create a temporary directory structure that mimics VOC2012
temp_dir = tempfile.mkdtemp()
voc_dir = os.path.join(temp_dir, 'VOC2012')
annot_dir = os.path.join(voc_dir, 'Annotations')
imgs_dir = os.path.join(voc_dir, 'JPEGImages')
imgsets_dir = os.path.join(voc_dir, 'ImageSets', 'Main')

os.makedirs(annot_dir)
os.makedirs(imgs_dir)
os.makedirs(imgsets_dir)

# Create trainval.txt file
trainval_path = os.path.join(imgsets_dir, 'trainval.txt')
with open(trainval_path, 'w') as f:
    f.write('image1\n')
    f.write('image2\n')

# Create test.txt file
test_path = os.path.join(imgsets_dir, 'test.txt')
with open(test_path, 'w') as f:
    f.write('image3\n')

# Create sample XML annotation files
for img_id in ['image1', 'image2', 'image3']:
    xml_path = os.path.join(annot_dir, f'{img_id}.xml')
    
    root = ET.Element('annotation')
    
    filename = ET.SubElement(root, 'filename')
    filename.text = f'{img_id}.jpg'
    
    size = ET.SubElement(root, 'size')
    width = ET.SubElement(size, 'width')
    width.text = '640'
    height = ET.SubElement(size, 'height')
    height.text = '480'
    
    # Add object
    obj = ET.SubElement(root, 'object')
    name = ET.SubElement(obj, 'name')
    name.text = 'person'
    difficult = ET.SubElement(obj, 'difficult')
    difficult.text = '0'
    
    bndbox = ET.SubElement(obj, 'bndbox')
    xmin = ET.SubElement(bndbox, 'xmin')
    xmin.text = '100'
    ymin = ET.SubElement(bndbox, 'ymin')
    ymin.text = '100'
    xmax = ET.SubElement(bndbox, 'xmax')
    xmax.text = '300'
    ymax = ET.SubElement(bndbox, 'ymax')
    ymax.text = '400'
    
    tree = ET.ElementTree(root)
    tree.write(xml_path)
    
    # Create dummy image files
    img_path = os.path.join(imgs_dir, f'{img_id}.jpg')
    with open(img_path, 'wb') as f:
        f.write(b'\xff\xd8\xff\xe0')  # JPEG header stub

ARGS = {
    'input_path': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2 — 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_data Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/simple_parser.py
code served (permissive licence) · get_code("435a2a871a9eb7c3")
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 cv2
import numpy as np
import tempfile
import os

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

# Create a simple test image and save it
test_image = np.random.randint(0, 256, (100, 150, 3), dtype=np.uint8)
image_path = os.path.join(temp_dir, "test_image.jpg")
cv2.imwrite(image_path, test_image)

# Create annotation file
annotation_file = os.path.join(temp_dir, "annotations.txt")
with open(annotation_file, 'w') as f:
    f.write(f"{image_path},10,20,50,80,cat\n")
    f.write(f"{image_path},60,30,140,90,dog\n")
    f.write(f"{image_path},5,5,15,15,bg\n")

ARGS = {
    'input_path': annotation_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, 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_img_output_length Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/resnet.py
code served (permissive licence) · get_code("b5afb710b31b739c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family 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 torch

torch.manual_seed(0)

ARGS = {
    "width": 256,
    "height": 512
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family 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
iou Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/data_generators.py
code served (permissive licence) · get_code("3347c438ffd1288b")
How it ran

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

import torch

torch.manual_seed(0)

# The iou function takes two bounding box arguments: a and b
# Each bounding box is a sequence of 4 values: [x1, y1, x2, y2]
# The function performs element-wise operations on these values

# Create two sample bounding boxes as lists
a = [10, 20, 50, 80]  # x1=10, y1=20, x2=50, y3=80
b = [30, 40, 70, 100]  # x1=30, y1=40, x2=70, y3=100

ARGS = {
    "a": a,
    "b": b
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rpn Ran
ran; our contract draft was wrong, not the code
milkplz/keras-frcnn/keras_frcnn/vgg.py
code served (permissive licence) · get_code("d00e643cbaa5b847")
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. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-26T21:51:12Z. 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 keras
import numpy as np
from keras.layers import Input
from keras.models import Model

# Create base_layers as a Keras tensor output
# The rpn function expects base_layers to be a tensor that can be passed through Conv2D layers
input_layer = Input(shape=(16, 16, 64))
base_layers = input_layer

# num_anchors is an integer representing the number of anchor boxes
num_anchors = 9

ARGS = {
    "base_layers": base_layers,
    "num_anchors": num_anchors
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, 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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
union Ran
ran on a synthesized input
milkplz/keras-frcnn/keras_frcnn/data_generators.py
code served (permissive licence) · get_code("7855b626f923050b")
How it ran

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

import torch

torch.manual_seed(0)

# The function expects:
# - au: a bounding box (x1, y1, x2, y2) - looks like a list/tuple of 4 numbers
# - bu: a bounding box (x1, y1, x2, y2) - looks like a list/tuple of 4 numbers
# - area_intersection: a scalar value representing intersection area

au = [10, 20, 30, 40]
bu = [25, 35, 45, 55]
area_intersection = 25.0

ARGS = {
    "au": au,
    "bu": bu,
    "area_intersection": area_intersection
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calc_iou Not yet run
unverified (harvested, no recorded run)
milkplz/keras-frcnn/keras_frcnn/roi_helpers.py
code served (permissive licence) · get_code("a4a32a93a4b2a1ba")
How it ran

no invocation recorded.

class_loss_regr Not yet run
unverified (harvested, no recorded run)
milkplz/keras-frcnn/keras_frcnn/losses.py
code served (permissive licence) · get_code("b6396e65cc2d636e")
How it ran

no invocation recorded.

intersection Not yet run
unverified (harvested, no recorded run)
milkplz/keras-frcnn/keras_frcnn/data_generators.py
code served (permissive licence) · get_code("6e6137b5ba0e8c93")
How it ran

no invocation recorded.

nn_base Not yet run
unverified (harvested, no recorded run)
milkplz/keras-frcnn/keras_frcnn/vgg.py
code served (permissive licence) · get_code("dcc94e6b36d98c9b")
How it ran

no invocation recorded.

rpn_loss_cls Not yet run
unverified (harvested, no recorded run)
milkplz/keras-frcnn/keras_frcnn/losses.py
code served (permissive licence) · get_code("7fa7565671a5e2b3")
How it ran

no invocation recorded.

rpn_loss_regr Not yet run
unverified (harvested, no recorded run)
milkplz/keras-frcnn/keras_frcnn/losses.py
code served (permissive licence) · get_code("c0ceb156b9cb836c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 later) and 10 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
class_loss_regr 1 other paper
1 later
1904.07305 (2019-04)
Automatic adaptation of object detectors to new domains using self-training
get_img_output_length 1 other paper
1 later
1904.07305 (2019-04)
Automatic adaptation of object detectors to new domains using self-training
rpn 1 other paper
1 later
1904.07305 (2019-04)
Automatic adaptation of object detectors to new domains using self-training
rpn_loss_cls 1 other paper
1 later
1904.07305 (2019-04)
Automatic adaptation of object detectors to new domains using self-training
rpn_loss_regr 1 other paper
1 later
1904.07305 (2019-04)
Automatic adaptation of object detectors to new domains using self-training

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

Existing person re-identification (re-id) methods either assume the availability of well-aligned person bounding box images as model input or rely on constrained attention selection mechanisms to calibrate misaligned images. They are therefore sub-optimal for re-id matching in arbitrarily aligned person images potentially with large human pose variations and unconstrained auto-detection errors. In this work, we show the advantages of jointly learning attention selection and feature representation in a Convolutional Neural Network (CNN) by maximising the complementary information of different levels of visual attention subject to re-id discriminative learning constraints. Specifically, we formulate a novel Harmonious Attention CNN (HA-CNN) model for joint learning of soft pixel attention and hard regional attention along with simultaneous optimisation of feature representations, dedicated to optimise person re-id in uncontrolled (misaligned) images. Extensive comparative evaluations validate the superiority of this new HA-CNN model for person re-id over a wide variety of state-of-the-art methods on three large-scale benchmarks including CUHK03, Market-1501, and DukeMTMC-ReID.

For agents

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

get_harvested_code_for_paper("1802.08122")
get_code_for_paper("1802.08122")
have("1802.08122")

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

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

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

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

Connect an agent — have() is free.