person re-id Β· vision Β· WASM Β· ~107 MB
Face recognition looks at a face. Person re-identification looks at the whole body β clothing, build, gait, colour β to decide whether two crops from different moments or cameras show the same individual. It's how retail analytics, sports tracking, and surveillance re-find a person after they leave one camera's view. YouTu-ReID maps each person crop to a 768-d embedding; the cosine similarity between two embeddings is the match score. Pick two people below and compare β entirely on your device, nothing leaves the tab.
| Model | opencv/person_reid_youtureid β YouTu-ReID (ResNet-50-IBN), OpenCV Zoo |
|---|---|
| Task | person-reid (whole-body appearance embedding) β run via raw ONNX Runtime Web (see note below) |
| Runtime | onnxruntime-web 1.21 (transformers.js has no person-reid class / no such task) |
| Input | input [1, 3, 256, 128] float32 in 0β1 β a person crop (plain RGB), tall aspect |
| Output | output [1, 768] float32 β an L2-normalised appearance embedding; cosine similarity = match score |
| Quantization | fp32 ONNX β runs on the plain WASM execution provider, no WebGPU needed |
| Backend | WebAssembly (single-threaded on GitHub Pages) β ~1 s per crop |
| Download | ~107 MB, cached after first load (auto-inits on return) |
| License | Apache-2.0 (OpenCV Zoo) |
| Web APIs | WebAssembly, Web Workers, OffscreenCanvas, ImageBitmap β all Baseline widely available |
The people below are cropped live from one licensed marathon photo (five distinct runners, plus a second, re-framed crop of the lead runner as a stand-in for a different-camera view). Click two crops to compare their appearance embeddings.
Pick two people to compare.
Transformers.js has no person-reid model class or task, so we run YouTu-ReID's ONNX graph directly
with onnxruntime-web and hand-write the pre/post a pipeline would own: crop each person to the fixed
128Γ256 input, pack it as [1,3,256,128] float32 in 0β1, and L2-normalise the 768-d
output so cosine similarity is the match score. Everything runs on your device.