Skip to content

Evaluate ReID

Use eval-reid to score a trained ReID checkpoint on a dataset's query/gallery split.

Examples

Example

Evaluate a checkpoint on Market1501:

boxmot eval-reid \
  --weights runs/reid_train/osnet_market/best.pt \
  --dataset market1501 \
  --data-dir /data/reid \
  --device 0

Save results to a custom directory:

boxmot eval-reid \
  --weights runs/reid_train/lmbn_joint/best.pt \
  --dataset msmt17 \
  --data-dir /data/reid \
  --batch-size 128 \
  --output runs/reid_eval

What it does

eval-reid loads a trained checkpoint, rebuilds the matching backbone, extracts query and gallery embeddings, computes the distance matrix, and reports ranking metrics.

If the checkpoint stores the model architecture, you can omit --model. Otherwise pass the architecture explicitly.

Main outputs

The command reports and saves:

  • mAP
  • rank1
  • rank5
  • rank10

By default the JSON summary is written next to the checkpoint as eval_<dataset>.json. Use --output to place it elsewhere.

Dataset expectations

eval-reid uses the same registered ReID datasets as training. The selected dataset must expose query and gallery splits under the dataset root passed to --data-dir.

Scope

eval-reid is available from both the CLI and Python facade via Boxmot.eval_reid(...).

CLI Arguments

boxmot eval-reid

Evaluate a trained ReID model on query/gallery

Usage:

boxmot eval-reid [OPTIONS]

Options:

Name Type Description Default
--weights path Path to trained ReID checkpoint (.pt) Sentinel.UNSET
--model text Model architecture (auto-detected from checkpoint if omitted) None
--dataset text Evaluation dataset (e.g. market1501, duke, msmt17) Sentinel.UNSET
--data-dir path Root directory of the dataset Sentinel.UNSET
--device text Device: cpu, mps, or cuda index cpu
--batch-size integer Batch size for feature extraction 64
--num-workers integer Dataloader workers 4
--output path Directory to save eval JSON (default: next to weights) None
--help boolean Show this message and exit. False