OSNet-AIN x1.0 (Zhou et al., TPAMI 2021) as a single self-contained ONNX file: person crops in, one 512-value embedding per crop out. Crops of the same person give embeddings with high cosine similarity, which lets you tell people apart across cameras with no torch dependency.
All credit for the model and its weights goes to Kaiyang Zhou and co-authors. This repository only repackages their published weights in ONNX format. The original weights are at kaiyangzhou/osnet, and the code that defines and trains the model is Torchreid.
Exported for Caliscope's cross-camera track association.
(N, 3, 256, 128) float32, RGB, scaled to [0, 1] and then normalized with the ImageNet mean (0.485, 0.456, 0.406) and standard deviation (0.229, 0.224, 0.225). The batch size N is dynamic. Resize each crop to 128 wide by 256 high with bilinear interpolation.(N, 512) float32. The embeddings are not unit length. Normalize each row before taking cosine similarity.None in the weights. The export is the upstream network in evaluation mode, which returns the 512-value feature and leaves out the training classifier. Embeddings match PyTorch to within 5e-5 on batches of 1, 3, and 32 crops.
osnet_ain_x1_0_msmt17_256x128_amsgrad_ep50_lr0.0015_coslr_b64_fb10_softmax_labsmth_flip_jitter.pth from kaiyangzhou/osnet, SHA-256 8a07e8da38946f7cee37f4561617bf8b6d2fe8f3a4027852893ea092e46d919f. The Torchreid model zoo lists this model under "MSMT17 (combineall=True)".osnet_ain_x1_0 from Torchreid at commit f8cd150.torch.onnx.export with opset 17 and a dynamic batch axis.f11a8fa82c3980f13f563210ddf197346bbd8d1bd0dca364c4ad6c4e39794116MIT, the license under which Kaiyang Zhou publishes both Torchreid and the original weights. If you use this model, cite the original work:
@article{zhou2021osnet,
author = {Kaiyang Zhou and Yongxin Yang and Andrea Cavallaro and Tao Xiang},
title = {Learning Generalisable Omni-Scale Representations for Person Re-Identification},
journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
year = {2021}
}
@inproceedings{zhou2019osnet,
author = {Kaiyang Zhou and Yongxin Yang and Andrea Cavallaro and Tao Xiang},
title = {Omni-Scale Feature Learning for Person Re-Identification},
booktitle = {ICCV},
year = {2019}
}
@article{torchreid,
author = {Kaiyang Zhou and Tao Xiang},
title = {Torchreid: A Library for Deep Learning Person Re-Identification in Pytorch},
journal = {arXiv preprint arXiv:1910.10093},
year = {2019}
}
The weights were trained on MSMT17:
@inproceedings{wei2018msmt17,
author = {Longhui Wei and Shiliang Zhang and Wen Gao and Qi Tian},
title = {Person Transfer GAN to Bridge Domain Gap for Person Re-Identification},
booktitle = {CVPR},
year = {2018}
}