Ultralytics YOLO27: Join the waitlist.
License YOLO
Back to Ultralytics Glossary

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:

  1. Detect and crop: A detector finds each person or vehicle, and the image inside its bounding box is cropped and resized.
  2. 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.
  3. 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.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning