Skip to content

Compare ReID

Use compare-reid to evaluate several ReID checkpoints across several target datasets and collect the results in one cross-domain comparison.

Example

boxmot compare-reid \
  --weights runs/reid_train/market/best.pt \
  --weights runs/reid_train/msmt17/best.pt \
  --label market-model \
  --label msmt17-model \
  --target market1501=/data/reid \
  --target msmt17=/data/reid \
  --device 0 \
  --output runs/reid_cross_domain

Repeat --weights for every checkpoint and --target DATASET=DATA_DIR for every evaluation target. If you pass --label, provide one label per checkpoint. An explicit --model may be supplied once for all checkpoints or once per checkpoint when the architecture cannot be recovered from metadata.

Cross-domain filtering

By default, checkpoint metadata is used to skip a target that matches that checkpoint's training dataset. Pass --include-same-dataset to evaluate those pairs too. If a checkpoint does not identify its training dataset, none of its targets are skipped.

Use --continue-on-error to record a failed checkpoint/target pair and continue the matrix. The default is to stop at the first error.

Outputs

The default output directory is runs/reid_cross_domain. It contains:

  • cross_domain_results.json, with aggregate counts and all result rows
  • cross_domain_results.md, with a readable comparison table
  • one subdirectory per model label, containing the individual eval JSON files
  • map_vs_latency.png when latency results are available

The latency plot is enabled by the default timed passes. Set --latency-iters 0 to disable latency measurement and the plot.

CLI Arguments

boxmot compare-reid

Compare ReID checkpoints across target datasets

Usage:

boxmot compare-reid [OPTIONS]

Options:

Name Type Description Default
--weights path Path to a trained ReID checkpoint. Repeat for multiple models. Sentinel.UNSET
--target text Evaluation target as DATASET=DATA_DIR. Repeat for multiple target datasets. Sentinel.UNSET
--label text Optional display/output label for each --weights entry. Sentinel.UNSET
--model text Model architecture override. Pass once for all weights or once per checkpoint. Sentinel.UNSET
--include-same-dataset / --cross-domain-only boolean Also evaluate models on their training dataset when checkpoint metadata is available. False
--preprocess choice (resize | resize_pad) Crop preprocessing method (default: checkpoint/hparams value) None
--imgsz text Image size as H,W (default: hparams value, fallback 256,128) None
--inference-feature choice (concat_bn | norm_concat_bn | global | raw_mean | raw_concat | visibility_weighted_parts | evidence_sinkhorn | dse_weighted | dse_mix) Override CSL-TinyViT eval embedding without retraining None
--flip-tta / --no-flip-tta boolean Use horizontal flip test-time augmentation (default: hparams value) None
--device text Device: cpu, mps, or cuda index cpu
--batch-size integer Batch size for feature extraction 64
--num-workers integer Dataloader workers 4
--latency-warmup integer Warmup forward passes before measuring ReID inference latency 5
--latency-iters integer Timed forward passes for ReID inference latency; 0 disables the mAP/latency plot 30
--continue-on-error / --fail-fast boolean Record failed pairs and continue instead of stopping at the first failure. False
--output path Directory to save aggregate comparison files and per-model eval JSONs runs/reid_cross_domain
--help boolean Show this message and exit. False