SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.00537 · 2019

Perceive Where to Focus: Learning Visibility-aware Part-level Features for Partial Person Re-identification

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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 4 have no contract verdict; 0 failures of our instrument; 4 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/1904.00537.json · badge: /api/ran/1904.00537.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
YifanSun-ReID/VPM-reID canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
generate_column_labels Ran
ran on a synthesized input
YifanSun-ReID/VPM-reID/reid/generate_column_labels.py
code served (permissive licence) · get_code("24aef7ffe5dd04cf")
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. 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
import numpy as np

torch.manual_seed(0)

# The function expects:
# - targets: a tensor that will be concatenated along dimension 1
# - ratio: a tensor that can be unsqueezed and expanded
# - start_ratio: a tensor that can be unsqueezed and expanded
# - num_parts: an integer

# Create small tensors with batch size 2
batch_size = 2

# targets should be a 1D or 2D tensor; function unsqueezes it to add a dimension
targets = torch.LongTensor([100, 200])

# ratio and start_ratio need to be tensors with batch_size elements
# They get unsqueezed and expanded, then used in float operations
ratio = torch.FloatTensor([1.5, 2.0])
start_ratio = torch.FloatTensor([0.1, 0.2])

# num_parts is an integer used for range generation and loop iterations
num_parts = 4

ARGS = {
    'targets': targets,
    'ratio': ratio,
    'start_ratio': start_ratio,
    'num_parts': num_parts
}
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
pairwise_distance Ran
ran on a synthesized input
YifanSun-ReID/VPM-reID/reid/evaluators.py
code served (permissive licence) · get_code("e6f090a0a1fb4c32")
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, 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 torch

torch.manual_seed(0)

# Analyzing the function:
# - query_features: dict-like, accessed with keys from query tuples
# - gallery_features: dict-like, accessed with keys from gallery tuples
# - query: None or list of tuples (f, _, _) where f is a key
# - gallery: None or list of tuples (f, _, _) where f is a key

# Creating small feature tensors (batch=2, dim=4)
query_features = {
    'img_0': torch.randn(4),
    'img_1': torch.randn(4),
}

gallery_features = {
    'img_2': torch.randn(4),
    'img_3': torch.randn(4),
}

# Creating query and gallery as lists of tuples (filename, _, _)
query = [
    ('img_0', None, None),
    ('img_1', None, None),
]

gallery = [
    ('img_2', None, None),
    ('img_3', None, None),
]

ARGS = {
    'query_features': query_features,
    'gallery_features': gallery_features,
    'query': query,
    'gallery': gallery,
}
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, 2) — shape (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
pairwise_distance Ran
ran on a synthesized input
YifanSun-ReID/VPM-reID/reid/evaluators_adaptive_part.py
code served (permissive licence) · get_code("b8bc227c6ed07393")
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, 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 torch

torch.manual_seed(0)

# Analyze the function:
# - query_features: dict indexed by feature_id, values are tensors
# - gallery_features: dict indexed by feature_id, values are tensors
# - query_parts: dict indexed by feature_id, values are tensors
# - gallery_parts: dict indexed by feature_id, values are tensors
# - query: list of tuples (feature_id, _, _)
# - gallery: list of tuples (feature_id, _, _)

# From the code:
# x = torch.cat([query_features[f].unsqueeze(0) for f, _, _ in query], 0)
# This means query_features[f] should be a tensor that can be unsqueezed
# x.size(0) = m (batch size of query)
# x.size(1) = feature dimension
# x.size(2) = num_parts (number of parts)
# The code does x.chunk(x.size(2), 2) to split by parts dimension
# Then later tmp.squeeze(3).squeeze(2) suggests initial shape has 4 dims

# So query_features and gallery_features values should be 3D tensors: (feat_dim, num_parts, 1)
# Actually, looking at squeeze(3).squeeze(2), we need 4D after cat and unsqueeze(0)
# After unsqueeze(0): (1, feat_dim, num_parts, ?)
# So individual tensors in query_features should be (feat_dim, num_parts, 1)

# query_parts and gallery_parts values should be 1D tensors (num_parts,)
# px = px.unsqueeze(1) makes it (m, 1, num_parts)

num_query = 2
num_gallery = 2
feat_dim = 4
num_parts = 3

# Create feature dictionaries
query_features = {
    f'q_{i}': torch.randn(feat_dim, num_parts, 1)
    for i in range(num_query)
}

gallery_features = {
    f'g_{i}': torch.randn(feat_dim, num_parts, 1)
    for i in range(num_gallery)
}

# Create parts dictionaries (1D tensors of size num_parts)
query_parts = {
    f'q_{i}': torch.randn(num_parts)
    for i in range(num_query)
}

gallery_parts = {
    f'g_{i}': torch.randn(num_parts)
    for i in range(num_gallery)
}

# Create query and gallery lists of tuples (feature_id, unused, unused)
query = [(f'q_{i}', None, None) for i in range(num_query)]
gallery = [(f'g_{i}', None, None) for i in range(num_gallery)]

ARGS = {
    'query_features': query_features,
    'gallery_features': gallery_features,
    'query_parts': query_parts,
    'gallery_parts': gallery_parts,
    'query': query,
    'gallery': gallery
}
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, 2) — shape (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
pairwise_distance_partial Ran
ran on a synthesized input
YifanSun-ReID/VPM-reID/reid/evaluators_partial_ilids.py
code served (permissive licence) · get_code("17d93169d26911cf")
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 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 torch

torch.manual_seed(0)

# Analyze the function:
# - query_features: dict with feature tensors, indexed by first element of tuples
# - gallery_features: dict with feature tensors, indexed by first element of tuples
# - query: list of tuples (f, _, _) where f is a key into query_features
# - gallery: list of tuples (f, _, _) where f is a key into gallery_features
# - The function extracts tensors and performs cropping operations on dimension 2
# - x and y are concatenated to shape [batch_size, feature_dim, height_dim]

# Create small feature dictionaries
query_features = {
    'q1': torch.randn(2, 5),  # feature_dim=5 for query
    'q2': torch.randn(2, 5),
}

gallery_features = {
    'g1': torch.randn(2, 5),  # feature_dim=5 for gallery
    'g2': torch.randn(2, 5),
}

# Create query list: tuples of (feature_key, dummy, dummy)
query = [
    ('q1', 0, 0),
    ('q2', 0, 0),
]

# Create gallery list: tuples of (feature_key, dummy, dummy)
gallery = [
    ('g1', 0, 0),
    ('g2', 0, 0),
]

# Wait, looking at the code more carefully:
# x = torch.cat([query_features[f].unsqueeze(0) for f, _, _ in query], 0)
# This means query_features[f] must be a 2D tensor, and unsqueeze(0) makes it 3D
# Then x.size(2) is accessed, so x must be 3D: [batch, feature_dim, height]
# Let me reconstruct with proper 3D tensors

query_features = {
    'q1': torch.randn(5, 4),   # [feature_dim, height]
    'q2': torch.randn(5, 4),
}

gallery_features = {
    'g1': torch.randn(5, 4),   # [feature_dim, height]
    'g2': torch.randn(5, 4),
}

query = [
    ('q1', 0, 0),
    ('q2', 0, 0),
]

gallery = [
    ('g1', 0, 0),
    ('g2', 0, 0),
]

ARGS = {
    'query_features': query_features,
    'gallery_features': gallery_features,
    'query': query,
    'gallery': gallery,
}
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 list, ndim 3, 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
evaluate_all Not yet run
unverified (harvested, no recorded run)
YifanSun-ReID/VPM-reID/reid/evaluators.py
code served (permissive licence) · get_code("86c7510a3d312224")
How it ran

no invocation recorded.

extract_features Not yet run
unverified (harvested, no recorded run)
YifanSun-ReID/VPM-reID/reid/evaluators.py
code served (permissive licence) · get_code("25770f415d336fca")
How it ran

no invocation recorded.

extract_features Not yet run
unverified (harvested, no recorded run)
YifanSun-ReID/VPM-reID/reid/evaluators_adaptive_part.py
code served (permissive licence) · get_code("071c5eaccfef0c9d")
How it ran

no invocation recorded.

oim Not yet run
unverified (harvested, no recorded run)
YifanSun-ReID/VPM-reID/reid/loss/oim.py
code served (permissive licence) · get_code("48cf1aad1e6a206d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 1 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
oim 3 other papers
1 dated earlier, 1 the same month, 1 later
1807.11334 (2018-07)
Unsupervised Domain Adaptive Re-Identification: Theory and Practice
1904.11397 (2019-04)
Deep Constrained Dominant Sets for Person Re-identification
1907.13315 (2019-07)
Self-training with progressive augmentation for unsupervised cross-domain person re-identification
evaluate_all 1 other paper
1 dated earlier
1512.04150 (2015-12)
Learning Deep Features for Discriminative Localization
pairwise_distance 1 other paper
1 dated earlier
1512.04150 (2015-12)
Learning Deep Features for Discriminative Localization

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

This paper considers a realistic problem in person re-identification (re-ID) task, i.e., partial re-ID. Under partial re-ID scenario, the images may contain a partial observation of a pedestrian. If we directly compare a partial pedestrian image with a holistic one, the extreme spatial misalignment significantly compromises the discriminative ability of the learned representation. We propose a Visibility-aware Part Model (VPM), which learns to perceive the visibility of regions through self-supervision. The visibility awareness allows VPM to extract region-level features and compare two images with focus on their shared regions (which are visible on both images). VPM gains two-fold benefit toward higher accuracy for partial re-ID. On the one hand, compared with learning a global feature, VPM learns region-level features and benefits from fine-grained information. On the other hand, with visibility awareness, VPM is capable to estimate the shared regions between two images and thus suppresses the spatial misalignment. Experimental results confirm that our method significantly improves the learned representation and the achieved accuracy is on par with the state of the art.

For agents

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

get_harvested_code_for_paper("1904.00537")
get_code_for_paper("1904.00537")
have("1904.00537")

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

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

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

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

Connect an agent — have() is free.