Datasets8 min read
Build a Person ReID Dataset: Boxes, Identities and Splits
Learn to build an auditable Person ReID dataset with identity labels, correct bounding boxes, variant lineage and leakage-resistant train/test splits.
You draw a perfect box around a dancer in the original photograph. Then the image is resized, black padding is added, and the label is copied without the padding offset. On the training canvas, your “perfect” box now points partly at the floor.
A Person ReID dataset can fail before the model sees its first crop. You have to preserve three kinds of truth at once: who the intended person is, where that person is in the source image, and which samples must remain separated during evaluation. A clean directory tree cannot rescue an identity collision, a shifted box or a leaked photo burst.
This guide uses the PolyReID April 2026 DINO-ReID technical report as a concrete engineering case study. That document is an internal, non-peer-reviewed report, not an independent benchmark or a general recipe. Its choices are useful examples to inspect; they should be tested rather than copied blindly.
For a broader introduction to embeddings and retrieval, see the Person ReID guide. For deciding whether an extracted image is usable at inference time, use the person-crop quality checklist.
Give every crop a paper trail
Before drawing hundreds of boxes, define what one trustworthy row looks like. A practical manifest can include:
| Field | Example | Why it exists |
|---|---|---|
asset_id | event7_img_004281 | Stable reference to the authorized source |
person_id | event7_student_023 | Namespaced identity, not a real-world name |
bbox_xyxy | [301, 98, 702, 761] | Box in original decoded-image pixels |
source_group | burst_0042 | Keeps related frames in one split |
camera_id | floor_north | Supports camera-aware evaluation |
session_id | event7_round2 | Enables cross-session tests |
annotation_state | verified | Distinguishes draft from approved truth |
variant_of | null | Links crops and masks back to the source |
Keep the direct identity key pseudonymous and scoped to the dataset purpose. Names, emails, roster records and consent evidence belong in a separately controlled system when they are genuinely required.
The Datasheets for Datasets framework is a useful structure for recording motivation, collection, annotation, intended uses, restrictions and maintenance. For people imagery, also document who could be affected by collection, who can correct labels, and how removal requests propagate to derived crops and embeddings.
Make “uncertain” a valid annotation
The internal April 2026 report describes manually curated dancer bounding boxes for a domain-specific detector and identity ground truth manually verified by professional event photographers. That is stronger than treating detector output or filename order as identity truth, but “manual” alone does not make labels reliable.
Give annotators written rules:
- label the intended person, not simply the largest visible body;
- use the same identity only when source context supports that conclusion;
- mark
uncertainrather than forcing a match; - mark boxes containing two inseparable people;
- record severe truncation, occlusion and blur;
- resolve disagreements through a second review;
- never infer a legal identity from visual similarity alone.
Sample double-annotation across easy and difficult scenes. Report agreement by decision type, not one blended percentage. A forced guess is not free: every crop placed under the wrong identity becomes a contradictory training signal.
Never lose the original coordinate system
Store bounding boxes in the coordinate system of the decoded, correctly oriented source image. Derived YOLO labels or crop coordinates should be reproducible outputs, not the only record.
The internal report describes detector-training images fitted into a 640×640 canvas with aspect ratio preserved and black padding. It then transforms each box into normalized YOLO center coordinates while accounting for both scaling and padding. Omitting the padding offset is a common reason for boxes that look consistently shifted.
For an original image of width (W) and height (H), fitted inside a square of size (S):
scale = min(S / W, S / H)
new_w = round(W × scale)
new_h = round(H × scale)
pad_left = actual horizontal padding placed before the image
pad_top = actual vertical padding placed before the image
x' = x × scale + pad_left
y' = y × scale + pad_top
For a transformed box ((x'_1, y'_1, x'_2, y'_2)), YOLO values are:
x_center = ((x'1 + x'2) / 2) / S
y_center = ((y'1 + y'2) / 2) / S
width = (x'2 - x'1) / S
height = (y'2 - y'1) / S
Use the actual integer padding offsets produced by the resize function. An odd padding remainder may put one extra pixel on the right or bottom.
Worked transform
Suppose a 1200×800 image is fitted into 640×640. The scale is about 0.5333, giving 640×427 pixels. If padding is centered, pad_left = 0 and pad_top = 106. An original box [300, 100, 700, 760] becomes approximately:
[160.0, 159.3, 373.3, 511.3]
The normalized YOLO label is approximately:
x_center=0.417, y_center=0.524, width=0.333, height=0.550
Test the transform by drawing converted boxes on the final training canvas. Include landscape, portrait, boundary-touching and odd-padding examples in automated tests.
Two detectors can agree on a box, not on a name
The April 2026 report describes two detectors:
- a custom model trained on manually annotated ballroom “student” boxes;
- a general COCO person detector with broader recall.
In that pipeline, high-confidence custom detections could pass directly, while weaker custom detections required overlap confirmation from the general person detector. The reported intersection-over-union cross-check used 0.35, and later heuristics considered containment, blur, minimum size, centrality and box shape.
This is a sensible proposal-generation pattern: one detector supplies domain knowledge while another catches unusual poses. But even perfect agreement only says “there is probably a person here.” It does not say which person. Keep these stages separate:
detectors propose boxes
→ selection policy chooses a candidate
→ annotator confirms person and identity
→ approved manifest becomes ground truth
Measure detector recall on a manually held-out set. If missed people never reach annotation, the resulting ReID data will inherit the detector’s blind spots.
Three visual variants, one underlying observation
The internal report created three parallel views for each event:
- raw event photographs;
- detector-generated body crops;
- background-removed crops.
It sampled these views during training at internally selected probabilities of 30% raw, 50% crop and 20% background-removed. The report says heavier use of background-removed views reduced robustness to real backgrounds. That is a project-specific observation, not a universal optimum.
Treat all three as variants of one source observation:
source asset A
├── raw view A
├── crop view A
└── background-removed view A
Those siblings should travel together. If you place them in different splits, the model can effectively meet the same photograph during training and evaluation. Store the cropper and segmentation revisions too. Background removal can suppress shortcuts, but it can also erase clothing edges, accessories or occluding context and introduce mask artifacts.
The innocent label that joins two strangers
The report records a severe failure when different sources reused labels such as student00. Its corrective pattern was to prefix each local identity with a dataset key—for example, hawaii_student00 and zenfolio_student00.
Use a mapping table rather than string conventions alone:
| dataset key | local label | global training key |
|---|---|---|
event_a | student00 | event_a:student00 |
event_b | student00 | event_b:student00 |
If evidence later shows that two event-local labels refer to the same participant, create an explicit, reviewable linkage. Do not silently merge keys based on nearest-neighbor scores. Conversely, one person appearing in different outfits may need one evaluation identity while retaining session-specific metadata for analysis.
Make each split answer one question
There are at least three split problems:
- Detector training: group by original source image or burst so crops from adjacent frames cannot cross train, validation and test.
- Representation development: reserve identities and, where possible, events or cameras for validation.
- Final retrieval evaluation: hold out identities never used for fitting, hyperparameter selection or threshold calibration.
For its custom detector, the internal report records Roboflow-style 70/20/10 train, validation and test partitions. The ratio is less important than the grouping rule: randomly splitting adjacent photographs or derived variants can put nearly identical evidence on both sides.
The April 2026 internal report describes a seeded, identity-stratified train/validation split in which identities with at least two samples can occur on both sides. That can answer a limited question about retrieval among known development identities. It does not demonstrate generalization to unseen identities, and it should not be presented as the standard identity-disjoint Person ReID protocol.
By contrast, the original Market-1501 benchmark formalized large-scale query-gallery evaluation with detector-produced boxes, while MSMT17 emphasized multiple cameras, indoor/outdoor scenes and lighting variation. Use such protocols as references, then state exactly how a private event-photo task differs.
Before you freeze a dataset version
- Original asset rights, purpose and retention are documented.
- Identity labels have
verified,uncertainand correction states. - Original-image coordinates remain recoverable.
- Resize-and-padding transforms have visual and unit tests.
- Detector proposals are not mistaken for identity truth.
- Raw, crop and masked variants share one lineage and split.
- Identity keys are namespaced across every source.
- Source bursts, identities and events are isolated as intended.
- Validation and final test have different roles.
- Dataset version, checksums, mappings and exclusions are frozen.
- A datasheet records limitations and maintenance.
A useful Person ReID dataset is not the one with the most crops. It is the one whose labels, geometry, lineage and evaluation boundaries can be inspected—and whose uncertainty remains visible.
Sources
- PolyReID, DINO-ReID: Occlusion-Robust Person Re-Identification via Confidence-Weighted Part Attention for Small-Scale Event Photography, internal technical report, April 2026. Non-peer-reviewed and not publicly released.
- Scalable Person Re-Identification: A Benchmark — ICCV 2015
- Person Transfer GAN to Bridge Domain Gap for Person Re-Identification — CVPR 2018
- Datasheets for Datasets — Gebru et al.