SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper · CVPR · 2024

CA-Jaccard: Camera-aware Jaccard Distance for Person Re-identification

Yixuan Zhu, Yiyu Chen, Zheyi Fan, Zhaoru Chen

Code that ran

6 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 0 have no contract verdict; 5 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper.json · badge: /api/ran/Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper.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
chen960/CA-Jaccard canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
cm Ran
ran; our contract draft was wrong, not the code
chen960/CA-Jaccard/caj/models/cm.py
code served (permissive licence) · get_code("10ba7332fd4a54eb")
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
from torch import nn, autograd

torch.manual_seed(0)

# Parameters for the cm function:
# - inputs: a tensor that will be matrix-multiplied with features.t()
# - indexes: target indices for updating features
# - features: a feature matrix that gets updated in backward
# - momentum: scalar momentum value

# Create small tensors with distinct dimensions
batch_size = 2
feature_dim = 4
num_features = 3

inputs = torch.randn(batch_size, feature_dim, requires_grad=True)
indexes = torch.tensor([0, 2], dtype=torch.long)
features = torch.randn(num_features, feature_dim, requires_grad=False)

# Normalize features as expected by the backward pass
features = features / features.norm(dim=1, keepdim=True)

momentum = 0.5

ARGS = {
    "inputs": inputs,
    "indexes": indexes,
    "features": features,
    "momentum": momentum,
}
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
conv3x3 Ran
ran; our contract draft was wrong, not the code
chen960/CA-Jaccard/caj/models/resnet_ibn_a.py
pointer only (licence: MIT); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
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 lixiaotong97/DSU, 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.

pairwise_distance Ran
ran, honoured the contract we drafted
chen960/CA-Jaccard/caj/evaluators.py
code served (permissive licence) · get_code("b6d5887f94b1db25")
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
import numpy as np

torch.manual_seed(0)

# Case 1: query=None and gallery=None
# The function expects features to be a dict where values() returns tensors
# that can be concatenated. n = len(features), and each tensor should be viewable as a vector.
features_dict = {
    'feat_0': torch.randn(4),  # 4-dim feature vector
    'feat_1': torch.randn(4),  # 4-dim feature vector
}

# Case 2: query and gallery are provided
# They are lists of tuples where each tuple is (feature_id, ..., ...)
# The function accesses features[f] for f being the first element of each tuple
query_list = [
    ('feat_0', 'label_0', 'cam_0'),
    ('feat_1', 'label_1', 'cam_1'),
]

gallery_list = [
    ('feat_0', 'label_0', 'cam_0'),
    ('feat_1', 'label_1', 'cam_1'),
]

# For the case with query and gallery, we need features dict with the feature ids
features_dict_case2 = {
    'feat_0': torch.randn(4),
    'feat_1': torch.randn(4),
}

# Test both cases by creating two different ARGS configurations
# We'll go with case 1 (query=None, gallery=None) as the primary setup
ARGS = {
    'features': features_dict,
    'query': None,
    'gallery': None,
}
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 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
process_dir Ran
ran; our contract draft was wrong, not the code
chen960/CA-Jaccard/caj/datasets/dukemtmcreid.py
code served (permissive licence) · get_code("7e822f939fbe184f")
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 2, 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 tempfile
import os

# Create a temporary directory with mock image files matching the expected pattern
temp_dir = tempfile.mkdtemp()

# Create some mock image files with names matching pattern: ([-\d]+)_c(\d)
mock_files = [
    "0001_c1.jpg",
    "0001_c2.jpg",
    "0002_c1.jpg",
    "0002_c3.jpg",
    "0003_c2.jpg",
    "-1_c1.jpg",  # This should be filtered out (pid == -1)
]

for fname in mock_files:
    fpath = os.path.join(temp_dir, fname)
    with open(fpath, 'w') as f:
        f.write("mock")

ARGS = {
    "dir_path": temp_dir,
    "relabel": False,
}
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 2, 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
resnet101_ibn_a Ran
ran; our contract draft was wrong, not the code
chen960/CA-Jaccard/caj/models/resnet_ibn_a.py
code served (permissive licence) · get_code("c7f5d45660e6ec13")
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 ResNet. 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
import math

torch.manual_seed(0)

# Define ARGS dictionary with parameters for resnet101_ibn_a
ARGS = {
    'pretrained': False,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
resnet50_ibn_a Ran
ran; our contract draft was wrong, not the code
chen960/CA-Jaccard/caj/models/resnet_ibn_a.py
code served (permissive licence) · get_code("93cbdbc352d644d9")
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 ResNet. 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)

ARGS = {
    'pretrained': False,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
build_pooling_layer Not yet run
unverified (harvested, no recorded run)
chen960/CA-Jaccard/caj/models/pooling.py
code served (permissive licence) · get_code("5c5d2f6f3c01ba6c")
How it ran

no invocation recorded.

extract_cnn_feature Not yet run
unverified (harvested, no recorded run)
chen960/CA-Jaccard/caj/evaluators.py
code served (permissive licence) · get_code("fbb5efeed7ebfd09")
How it ran

no invocation recorded.

extract_features Not yet run
unverified (harvested, no recorded run)
chen960/CA-Jaccard/caj/evaluators.py
pointer only (licence: MIT); the stored copy get_code serves, from whbdmu/FOUS, is pointer only (licence: NONE) · get_code("962810c012a60817")
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 whbdmu/FOUS, 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. No invocation recorded.

label_generator_kmeans Not yet run
unverified (harvested, no recorded run)
chen960/CA-Jaccard/caj/models/kmeans.py
code served (permissive licence) · get_code("4560dc753fea5981")
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 10 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 1 later) and 0 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
548 dated earlier, 28 later, 110 same year, order not determinable · 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
pairwise_distance 7 other papers
4 dated earlier, 3 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
136740192 (2022 (year only))
PASS: Part-Aware Self-Supervised Pre-Training for Person Re-Identification
and 4 more not named here
cm 6 other papers
4 dated earlier, 2 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
136740192 (2022 (year only))
PASS: Part-Aware Self-Supervised Pre-Training for Person Re-Identification
and 3 more not named here
extract_cnn_feature 6 other papers
4 dated earlier, 2 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
aaai_19970 (2022 (year only))
SECRET: Self-Consistent Pseudo Label Refinement for Unsupervised Domain Adaptive Person Re-identification
and 3 more not named here
label_generator_kmeans 6 other papers
4 dated earlier, 2 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
136740192 (2022 (year only))
PASS: Part-Aware Self-Supervised Pre-Training for Person Re-Identification
and 3 more not named here
build_pooling_layer 5 other papers
4 dated earlier, 1 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
136740192 (2022 (year only))
PASS: Part-Aware Self-Supervised Pre-Training for Person Re-Identification
and 2 more not named here
resnet101_ibn_a 5 other papers
4 dated earlier, 1 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
136740192 (2022 (year only))
PASS: Part-Aware Self-Supervised Pre-Training for Person Re-Identification
and 2 more not named here
resnet50_ibn_a 5 other papers
4 dated earlier, 1 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
136740192 (2022 (year only))
PASS: Part-Aware Self-Supervised Pre-Training for Person Re-Identification
and 2 more not named here
extract_features 4 other papers
3 dated earlier, 1 same year, order not determinable
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
2311.10605 (2023-11)
CA-Jaccard: Camera-aware Jaccard Distance for Person Re-identification
and 1 more not named here
process_dir 3 other papers
3 dated earlier
1807.09441 (2018-07)
Two at Once: Enhancing Learning and Generalization Capacities via IBN-Net
2103.11568 (2021-03)
Cluster Contrast for Unsupervised Person Re-Identification
2311.10605 (2023-11)
CA-Jaccard: Camera-aware Jaccard Distance for 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-24.

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 (re-ID) is a challenging task that aims to learn discriminative features for person retrieval. In person re-ID, Jaccard distance is a widely used distance metric, especially in re-ranking and clustering scenarios. However, we discover that camera variation has a significant negative impact on the reliability of Jaccard distance. In particular, Jaccard distance calculates the distance based on the overlap of relevant neighbors. Due to camera variation, intra-camera samples dominate the relevant neighbors, which reduces the reliability of the neighbors by introducing intra-camera negative samples and excluding inter-camera positive samples. To overcome this problem, we propose a novel camera-aware Jaccard (CA-Jaccard) distance that leverages camera information to enhance the reliability of Jaccard distance. Specifically, we design camera-aware k-reciprocal nearest neighbors (CK-RNNs) to find k-reciprocal nearest neighbors on the intracamera and inter-camera ranking lists, which improves the reliability of relevant neighbors and guarantees the contribution of inter-camera samples in the overlap. Moreover, we propose a camera-aware local query expansion (CLQE) to mine reliable samples in relevant neighbors by exploiting camera variation as a strong constraint and assign these samples higher weights in overlap, further improving the reliability. Our CA-Jaccard distance is simple yet effective and can serve as a general distance metric for person re-ID methods with high reliability and low computational cost. Extensive experiments demonstrate the effectiveness of our method. Code is available at https: //github.com/chen960/CA-Jaccard/.

For agents

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

get_harvested_code_for_paper("Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper")
get_code_for_paper("Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper")
have("Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper")

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

curl https://syntology.ai/api/ran/Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper.json

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

[![Syntology run record](https://syntology.ai/api/ran/Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper.svg)](https://syntology.ai/paper/Chen_CA-Jaccard_Camera-aware_Jaccard_Distance_for_Person_Re-identification_CVPR_2024_paper)

Connect an agent — have() is free.