OSNet x1.0 — Pretrained for Person Re-Identification
Our pretrained OSNet x1.0 model for pedestrian re-identification, trained on the Market-1501 dataset. This model powers the appearance-based matching in our RetailHeat multi-object tracking pipeline.
Model Details
| Property | Value |
|---|---|
| Architecture | OSNet x1.0 (Omni-Scale Network) |
| Parameters | 2.2 M |
| Embedding dim | 512-D (L2-normalized) |
| Input size | 256 × 128 (H × W) |
| Training dataset | Market-1501 (12,936 training images, 751 identities) |
| Task | Person re-identification |
Performance
| Metric | Value |
|---|---|
| Rank-1 Accuracy | 94.2% |
| mAP | 82.6% |
Architecture
OSNet (Omni-Scale Network) is a lightweight CNN designed for person re-identification. It uses omni-scale feature learning to capture discriminative features at multiple spatial scales through a unified aggregation gate. The x1.0 variant provides the best accuracy–efficiency trade-off with only 2.2M parameters, making it suitable for real-time tracking applications.
Training
We trained this model on the Market-1501 person re-identification benchmark:
- Dataset: Market-1501 — 32,668 bounding boxes of 1,501 identities captured from 6 cameras
- Training split: 12,936 images of 751 identities
- Query/Gallery: 19,732 images of 750 identities
- Optimizer: AMSGrad with learning rate warm-up and cosine annealing
- Augmentations: Random horizontal flip, random erasing, color jitter
- Loss: Cross-entropy + triplet loss with hard mining
Usage
Download the weights
pip install huggingface_hub
huggingface-cli download MYerassyl/retail-heat-osnet osnet_x1_0_market1501.pth --local-dir weights/
Load in Python
import torch
from torchvision import transforms
# Build OSNet model
from reid_embedder import ReIDEmbedder
embedder = ReIDEmbedder(
model_name="osnet_x1_0",
model_path="weights/osnet_x1_0_market1501.pth",
image_size=(256, 128),
)
# Extract embedding from a cropped person image
embedding = embedder.extract(person_crop) # returns 512-D L2-normalized vector
Use with the RetailHeat pipeline
This model is used as the appearance encoder in the DeepSORT tracker within our RetailHeat pipeline for retail customer tracking and heatmap generation.
git clone https://github.com/MYerassyl/retail-heat.git
cd retail-heat
mkdir -p weights
huggingface-cli download MYerassyl/retail-heat-osnet osnet_x1_0_market1501.pth --local-dir weights/
python run_pipeline.py
Citation
If you use this model, please cite our RetailHeat project:
@software{retail_heat,
author = {Yerassyl},
title = {RetailHeat: Multi-Object Tracking and Heatmap Generation for Retail Analytics},
url = {https://github.com/MYerassyl/retail-heat}
}
License
This model is released under the MIT License.