All guides

Engineering6 min read

Person crop quality for ReID: an input checklist

Prepare reliable Person ReID crops by controlling subject count, framing, blur, occlusion, truncation, resizing and quality-gate decisions.

A good Person ReID input is not simply a sharp photograph. It is a crop that contains one intended person, enough useful appearance, limited unrelated background and a preprocessing path consistent with the gallery. Rejecting an unusable crop is often safer than asking a similarity threshold to compensate for it.

There is no universal pixel size, body margin or blur cutoff that guarantees retrieval quality. Those choices depend on the model, source images and operating domain. Define a crop policy, evaluate it with representative data, and version it alongside the model.

Treat crop creation as part of the ReID system

The embedding endpoint starts after person localization. It does not know whether the box came from a detector, a photographer’s selection or another pipeline. If the wrong person occupies the crop, the resulting vector can be internally valid while representing the wrong subject.

A useful crop policy aims for:

  • exactly one primary person;
  • the body regions that are genuinely available in the source image;
  • minimal inclusion of adjacent people and repeated background;
  • consistent orientation, color decoding and resize behavior;
  • no geometry-distorting client transformation;
  • traceable detector, cropper and preprocessing versions.

The practical Person ReID guide explains why detection, embedding, retrieval and review should remain separate stages. The public PolyReID API page is the source of truth for accepted formats and current request limits.

What common crop defects do

Two or more people. The embedding may combine cues from the intended subject, a partner and the background. In ballroom photography, overlapping couples make this a frequent ambiguity. A detector box is not proof that only one person contributes pixels.

Severe truncation. A head-only, shoe-only or narrow torso crop contains a different evidence pattern from a full or mostly visible person. Partial crops may still be useful with a model and protocol designed for them, but they should not be silently mixed into a holistic workflow.

Occlusion. Furniture, another dancer, a raised arm or a competition number can hide useful appearance. Research such as Pose-Guided Feature Alignment for Occluded Person Re-Identification exists precisely because visible and occluded regions require special handling. Its results do not imply that every general embedding is occlusion-robust.

Motion blur and defocus. Texture and boundaries can disappear. A blur score can flag extreme cases, but it is not a universal ReID-quality measurement: patterned flooring may look sharp while the person is blurred.

Excess background. Venue branding, floor color or a recurring wall can become a shortcut. A loose crop may retrieve the same camera view rather than the same appearance.

Clipped edges and detection offset. Cutting through the body or centring on the wrong subject creates spatial misalignment. The Densely Semantically Aligned Person Re-Identification paper documents imperfect detection, viewpoint, clutter and occlusion as alignment challenges.

Build a deterministic crop pipeline

An auditable pipeline can follow these steps:

  1. Decode once. Apply the intended image orientation and convert to a documented color representation.
  2. Select the subject. Associate the requested detection or human selection with one person. Do not choose “the largest box” without checking that this matches the product interaction.
  3. Apply a versioned margin. If context around a detector box is needed, use a policy evaluated on the target domain. Clamp the result to the image boundary.
  4. Validate the crop. Check dimensions, decode errors, subject count, clipping indicators and obvious corruption.
  5. Preserve geometry. Avoid stretching a tall crop into a different aspect ratio in client code. Let the documented model preprocessing own resize and padding, or reproduce that preprocessing exactly.
  6. Record provenance. Store source asset ID, box coordinates, cropper revision and quality decision without retaining more personal data than the purpose requires.

Repeated JPEG encoding is also unnecessary. Crop from the best authorized source available and avoid chains of thumbnails when the original pipeline can provide a direct crop.

Use a quality gate, not a magic quality score

Individual checks are useful signals:

  • crop width, height and area;
  • box area relative to the source;
  • whether the box touches an image boundary;
  • estimated number and overlap of person detections;
  • blur or exposure proxies;
  • fraction of padding introduced;
  • detector confidence and detector revision.

None is sufficient alone. Detector confidence estimates the detector’s task, not whether the crop will retrieve the right neighbours. Combine deterministic rejection rules for clearly invalid input with a review state for ambiguous input. Keep the raw signals so rules can be reevaluated later.

Create a small labeled quality taxonomy such as usable, review, wrong-subject, multi-person, truncated, occluded and blurred. Sample crops from every camera and venue, not only API errors. Then connect quality labels to the Person ReID evaluation metrics: measure Rank-k, mAP, false candidates and review workload per quality slice.

Keep query and gallery policies compatible

A carefully framed query compared with a gallery of loose, multi-person crops is still an inconsistent system. Apply the same orientation and model preprocessing to both sides, and document any intentional difference in crop generation.

Do not pre-filter the gallery using the final similarity score and then evaluate on that same filtered set. Keep the full test protocol fixed. When selecting the similarity threshold, include the crop-quality states that can reach production. Otherwise the measured threshold only describes ideal inputs.

For approximate vector search, preserve the model and preprocessing versions with each vector as described in ReID embeddings and vector databases. Regenerate incompatible gallery vectors rather than mixing old and new crop policies invisibly.

Example: a crowded dance photograph

Suppose a wide frame contains two couples crossing. The product asks for the competitor in the foreground.

  1. Retain the explicit user or roster selection rather than automatically choosing the biggest detection.
  2. Inspect overlap with the partner and nearby detections.
  3. Crop the selected box with the tested margin, clamped at the frame.
  4. Mark significant partner overlap as review; do not hide it behind a high detector confidence.
  5. Generate the embedding only if the policy permits.
  6. Return neighbours as candidates and retain human confirmation for the ambiguous group.

If this situation is common, it belongs in calibration and final testing. It is not an isolated edge case.

Monitor crop drift

Track quality-signal distributions by camera and cropper revision. A new detector, export preset, portrait orientation or thumbnail provider can change inputs without changing the ReID model. The domain-shift playbook describes how to pair these signals with labeled sentinel queries.

Investigate changes rather than immediately loosening the threshold. A lower score may reflect a faulty orientation step or a new multi-person crop pattern. Threshold changes can conceal the symptom while increasing false matches elsewhere.

Finally, minimize the crop and its retention to the stated purpose. Background removal is not automatically better for model quality, but avoiding unnecessary people and context can reduce both retrieval shortcuts and privacy exposure. Crop quality is therefore a joint engineering, evaluation and governance concern—not a cosmetic preprocessing tweak.