SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.13143 · 2019

Semantics-Aligned Representation Learning for Person Re-identification

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 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 4 have no contract verdict; 3 failures of our instrument; 3 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/1905.13143.json · badge: /api/ran/1905.13143.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
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
conv3x3 Ran
ran; our contract draft was wrong, not the code
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/models/resnet.py
code served (permissive licence) · get_code("dd1114865f06f0fd")
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 Conv2d. 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 = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
eval_cuhk03 Ran
ran on a synthesized input
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/eval_metrics.py
code served (permissive licence) · get_code("d100118814161b20")
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

# Set seed for reproducibility
np.random.seed(0)

# Create small valid arguments for eval_cuhk03
num_queries = 3
num_gallery = 5
max_rank_val = 4

# Distance matrix: num_queries x num_gallery
# Small random distances
distmat = np.random.rand(num_queries, num_gallery).astype(np.float32)

# Query person IDs: num_queries
q_pids = np.array([0, 1, 0], dtype=np.int64)

# Gallery person IDs: num_gallery
g_pids = np.array([0, 1, 2, 0, 1], dtype=np.int64)

# Query camera IDs: num_queries
q_camids = np.array([0, 1, 2], dtype=np.int64)

# Gallery camera IDs: num_gallery
g_camids = np.array([0, 1, 2, 1, 0], dtype=np.int64)

# Max rank for evaluation
max_rank = max_rank_val

ARGS = {
    "distmat": distmat,
    "q_pids": q_pids,
    "g_pids": g_pids,
    "q_camids": q_camids,
    "g_camids": g_camids,
    "max_rank": max_rank,
}
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
eval_market1501 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/eval_metrics.py
code served (permissive licence) · get_code("acf991f06281a336")
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

# Create small example data for market1501 evaluation
# distmat: (num_queries, num_gallery) distance matrix
# q_pids: query person IDs
# g_pids: gallery person IDs
# q_camids: query camera IDs
# g_camids: gallery camera IDs
# max_rank: maximum rank to compute CMC

num_queries = 2
num_gallery = 5
max_rank = 3

# Distance matrix - smaller distances mean better matches
# Shape: (num_queries, num_gallery)
distmat = np.array([
    [0.1, 0.5, 0.3, 0.8, 0.9],
    [0.4, 0.2, 0.7, 0.1, 0.6]
], dtype=np.float32)

# Query person IDs - which identity each query belongs to
q_pids = np.array([0, 1], dtype=np.int32)

# Gallery person IDs - which identity each gallery image belongs to
# Some match queries (0 and 1), others don't
g_pids = np.array([0, 2, 0, 1, 3], dtype=np.int32)

# Query camera IDs - which camera each query was taken from
q_camids = np.array([0, 1], dtype=np.int32)

# Gallery camera IDs - which camera each gallery image was taken from
g_camids = np.array([0, 0, 1, 1, 2], dtype=np.int32)

ARGS = {
    'distmat': distmat,
    'q_pids': q_pids,
    'g_pids': g_pids,
    'q_camids': q_camids,
    'g_camids': g_camids,
    'max_rank': max_rank
}
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
evaluate_py Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/eval_metrics.py
code served (permissive licence) · get_code("6c4da11cacaff831")
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

# Set seed for reproducibility
np.random.seed(0)

# Create small synthetic data for evaluation
num_queries = 2
num_gallery = 4
max_rank_val = 3

# Distance matrix: queries x gallery
# Small distances indicate similarity
distmat = np.random.rand(num_queries, num_gallery).astype(np.float32)

# Query person IDs: one ID per query image
q_pids = np.array([0, 1], dtype=np.int32)

# Gallery person IDs: can have multiple images per person
g_pids = np.array([0, 0, 1, 2], dtype=np.int32)

# Query camera IDs: which camera each query was taken from
q_camids = np.array([1, 2], dtype=np.int32)

# Gallery camera IDs: which camera each gallery image was taken from
g_camids = np.array([1, 2, 2, 1], dtype=np.int32)

# Maximum rank for CMC computation
max_rank = max_rank_val

# Use market1501 metric (False) or cuhk03 metric (True)
use_metric_cuhk03 = False

ARGS = {
    'distmat': distmat,
    'q_pids': q_pids,
    'g_pids': g_pids,
    'q_camids': q_camids,
    'g_camids': g_camids,
    'max_rank': max_rank,
    'use_metric_cuhk03': use_metric_cuhk03
}
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
image_dataset_kwargs Ran
ran on a synthesized input
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/args.py
code served (permissive licence) · get_code("982f71a5bf0436f5")
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
from argparse import Namespace

torch.manual_seed(0)

# Create a mock parsed_args object with all required attributes
parsed_args = Namespace(
    source_names=['market1501'],
    target_names=['dukemtmc'],
    root='/tmp/data',
    split_id=0,
    height=256,
    width=128,
    train_batch_size=32,
    test_batch_size=64,
    workers=4,
    train_sampler='RandomSampler',
    num_instances=4,
    cuhk03_labeled=True,
    cuhk03_classic_split=False
)

ARGS = {
    'parsed_args': parsed_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
init_optimizer Ran
ran on a synthesized input
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/optimizers.py
code served (permissive licence) · get_code("8f45a875ca759c55")
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 Adam. 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 small model with parameters to optimize
model = nn.Sequential(
    nn.Linear(4, 3),
    nn.ReLU(),
    nn.Linear(3, 2)
)

# Extract parameters from the model
params = model.parameters()

ARGS = {
    'params': params,
    'optim': 'adam',
    'lr': 0.003,
    'weight_decay': 0.0005,
    'momentum': 0.9,
    'sgd_dampening': 0,
    'sgd_nesterov': False,
    'rmsprop_alpha': 0.99,
    'adam_beta1': 0.9,
    'adam_beta2': 0.999
}
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 Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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
optimizer_kwargs Ran
ran on a synthesized input
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/args.py
code served (permissive licence) · get_code("22c90ccd7fb0837e")
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 argparse

# Create a minimal argparse.Namespace object that mimics parsed command-line arguments
parsed_args = argparse.Namespace(
    optim='adam',
    lr=0.001,
    weight_decay=1e-5,
    momentum=0.9,
    sgd_dampening=0.0,
    sgd_nesterov=False,
    rmsprop_alpha=0.99,
    adam_beta1=0.9,
    adam_beta2=0.999
)

ARGS = {
    'parsed_args': parsed_args
}
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
read_image Ran
ran, honoured the contract we drafted
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/dataset_loader.py
pointer only (licence: MIT); the stored copy get_code serves, from suntongtongtong/benchmark-robustness-text-image-compose-retrieval, is pointer only (licence: NONE) · get_code("e3cbae59cb5ed741")
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 suntongtongtong/benchmark-robustness-text-image-compose-retrieval, 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.

build_transforms Not yet run
unverified (harvested, no recorded run)
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/transforms.py
code served (permissive licence) · get_code("fe7e035b56b0c148")
How it ran

no invocation recorded.

resnet50 Not yet run
unverified (harvested, no recorded run)
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/models/resnet.py
code served (permissive licence) · get_code("f42752ad0e2f6c85")
How it ran

no invocation recorded.

resnet50_fc512 Not yet run
unverified (harvested, no recorded run)
microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification/torchreid/models/resnet.py
code served (permissive licence) · get_code("c48cb0d4e0d8fe1d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 1 the same month, 6 later) and 5 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
conv3x3 686 other papers
119 dated earlier, 12 the same month, 555 later · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
read_image 10 other papers
2 dated earlier, 8 later
1903.07071 (2019-03)
Bag of Tricks and A Strong Baseline for Deep Person Re-identification
1904.07223 (2019-04)
Joint Discriminative and Generative Learning for Person Re-identification
1908.01114 (2019-08)
ABD-Net: Attentive but Diverse Person Re-Identification
and 7 more not named here
eval_market1501 2 other papers
1 dated earlier, 1 later
1805.09501 (2018-05)
AutoAugment: Learning Augmentation Policies from Data
1908.01114 (2019-08)
ABD-Net: Attentive but Diverse Person Re-Identification
evaluate_py 2 other papers
1 dated earlier, 1 later
1805.09501 (2018-05)
AutoAugment: Learning Augmentation Policies from Data
1908.01114 (2019-08)
ABD-Net: Attentive but Diverse Person Re-Identification
eval_cuhk03 1 other paper
1 later
1908.01114 (2019-08)
ABD-Net: Attentive but Diverse Person Re-Identification
optimizer_kwargs 1 other paper
1 later
1908.01114 (2019-08)
ABD-Net: Attentive but Diverse Person Re-Identification

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

Person re-identification (reID) aims to match person images to retrieve the ones with the same identity. This is a challenging task, as the images to be matched are generally semantically misaligned due to the diversity of human poses and capture viewpoints, incompleteness of the visible bodies (due to occlusion), etc. In this paper, we propose a framework that drives the reID network to learn semantics-aligned feature representation through delicate supervision designs. Specifically, we build a Semantics Aligning Network (SAN) which consists of a base network as encoder (SA-Enc) for re-ID, and a decoder (SA-Dec) for reconstructing/regressing the densely semantics aligned full texture image. We jointly train the SAN under the supervisions of person re-identification and aligned texture generation. Moreover, at the decoder, besides the reconstruction loss, we add Triplet ReID constraints over the feature maps as the perceptual losses. The decoder is discarded in the inference and thus our scheme is computationally efficient. Ablation studies demonstrate the effectiveness of our design. We achieve the state-of-the-art performances on the benchmark datasets CUHK03, Market1501, MSMT17, and the partial person reID dataset Partial REID. Code for our proposed method is available at: https://github.com/microsoft/Semantics-Aligned-Representation-Learning-for-Person-Re-identification.

For agents

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

get_harvested_code_for_paper("1905.13143")
get_code_for_paper("1905.13143")
have("1905.13143")

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

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

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

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

Connect an agent — have() is free.