Object Re-identification (Re-ID)
Object re-identification (Re-ID) recognizes the same person or vehicle again across cameras, time gaps, and occlusions by comparing appearance embeddings.
Object re-identification (Re-ID) is a computer vision task that recognizes the same object again when it reappears in a different camera, at a later time, or after being hidden. Where object detection reports that an image contains a person, Re-ID decides whether that person is the one who walked past the entrance camera ten minutes earlier. It does this by comparing appearance, such as clothing colors, body shape, carried bags, or a vehicle's color and roof details, which makes it the main tool for linking sightings in camera networks with no overlap between views. Person Re-ID and vehicle Re-ID are the most studied forms.
How Re-Identification Works#
A Re-ID system turns each detected object into a compact appearance descriptor and compares those descriptors:
- Detect and crop: A detector finds each person or vehicle, and the image inside its bounding box is cropped and resized.
- Encode into an embedding: A convolutional neural network or vision transformer maps the crop to a vector of a few hundred to a few thousand numbers that summarizes the object's appearance.
- Match by cosine similarity: The query embedding is scored against a gallery of stored embeddings, and the gallery is ranked from most to least similar; some systems use Euclidean distance instead.
A threshold on the best score then decides whether the query is a known identity or a new one:
Encoders are trained with metric learning so that embeddings of the same identity cluster together and embeddings of different identities spread apart. A common recipe combines an identity classification loss with a triplet loss, which pulls an anchor image toward another image of the same identity and pushes it away from an image of a different one, using hard negative mining to focus on look-alikes. The hard part is invariance: the same person must map to nearby embeddings across viewpoints, lighting, resolution, and partial occlusion.
Re-ID vs. Tracking and Facial Recognition#
Re-ID is often confused with two neighboring tasks:
- Object tracking: Follows objects within one video by predicting their motion, usually with a Kalman filter, and matching boxes by overlap from frame to frame. It relies on temporal continuity, which breaks when an object is occluded for long or leaves the view; Re-ID restores identity in exactly those gaps.
- Facial recognition: Identifies a person from facial features that stay stable for years and requires a visible face. Person Re-ID works from behind and at low resolution, and because it relies largely on clothing, it is generally valid only over hours or a day.
Re-ID Inside Multi-Object Trackers#
Since DeepSORT in 2017, many multi-object tracking (MOT) trackers have fused Re-ID embeddings with motion cues, so two people who cross paths keep their own IDs and a person who disappears behind a pillar gets the old ID back. In Ultralytics YOLO track mode, the BoT-SORT, Deep OC-SORT, and TrackTrack trackers accept with_reid: True and can load YOLO26 Re-ID encoders, from yolo26n-reid.onnx to yolo26x-reid.onnx, which download on first use:
from ultralytics import YOLO
from ultralytics.utils import YAML
from ultralytics.utils.checks import check_yaml
# Copy the default TrackTrack settings and enable Re-ID with a YOLO26 appearance encoder
cfg = YAML.load(check_yaml("tracktrack.yaml"))
cfg.update(with_reid=True, model="yolo26n-reid.onnx")
YAML.save("tracktrack_reid.yaml", cfg)
# Track people (class 0); appearance embeddings help restore IDs after occlusions
model = YOLO("yolo26n.pt")
source = "https://github.com/ultralytics/assets/releases/download/v0.0.0/decelera_portrait_min.mov"
identities = set()
for result in model.track(source, tracker="tracktrack_reid.yaml", classes=[0], stream=True):
if result.boxes.is_track:
identities.update(result.boxes.id.int().tolist())
print(f"Person identities assigned: {len(identities)}")Every ID the tracker recovers after an occlusion keeps the printed count closer to the true number of people in the video.
Real-World Applications#
- Retail analytics: Linking a shopper's sightings across aisle cameras yields anonymous store-wide paths, dwell times, and conversion funnels.
- Traffic management: Vehicle Re-ID connects sightings of the same car at different intersections to measure travel times and origin-destination flows, including when license plates are unreadable.
- Sports: Player Re-ID keeps identities consistent when players leave the broadcast frame or cluster in a scrum.
- Wildlife research: Animal Re-ID identifies individual zebras, whales, or big cats from coat patterns and fin markings in camera-trap and drone images.
Benchmarks and Metrics#
Re-ID is evaluated as a retrieval problem. Rank-1 accuracy is the share of queries whose top-ranked gallery image shows the correct identity, and mean average precision (mAP) scores how well all correct matches rank across the whole gallery. Market-1501, the classic person Re-ID benchmark, contains 32,668 bounding boxes of 1,501 people captured by six cameras on a university campus.










