license: apache-2.0 library_name: transformers tags: - person-reid - re-identification - vision-transformer - custom-code pipeline_tag: image-feature-extraction
PersonViT ReID MSMT17 ViT-S
This repository is a simple Hugging Face port of a PersonViT / TransReID person re-identification model.
The port was AI-generated and very lightly packaged for inference use. It is essentially a Codex vibe-coded Hugging Face wrapper around the original checkpoint format.
Source
Original upstream code / paper implementation reference:
Attribution
This repository is a Hugging Face Transformers port of the original PersonViT / TransReID model.
Original work:
- PersonViT: Large-scale Self-supervised Vision Transformer for Person Re-Identification
- Authors: Bin Hu, Xinggang Wang, Wenyu Liu
- Original repository: https://github.com/hustvl/PersonViT
- Paper: https://arxiv.org/abs/2408.05398
The original work is licensed under the Apache License 2.0. This repository preserves that license.
What This Repo Contains
This repo contains:
- a Hugging Face
config.json preprocessor_config.json- custom
configuration_personvit_reid.py - custom
modeling_personvit_reid.py - converted model weights in
model.safetensors
Intended Use
This model is intended for:
- person crop embedding extraction
- person re-identification / tracking
- loading via:
from transformers import AutoModel, CLIPImageProcessor
model = AutoModel.from_pretrained(
"your-username/personvit-reid-msmt17-vit-s",
trust_remote_code=True,
)
processor = CLIPImageProcessor.from_pretrained(
"your-username/personvit-reid-msmt17-vit-s"
)
## Notes
This is not an official upstream Hugging Face release.
It is a custom inference port for practical integration.
Use trust_remote_code=True when loading.
# PersonViT ReID Hugging Face Scaffold
This directory is an inference-only Hugging Face model-repo scaffold for a
person ReID model intended to be loaded through:
```python
from transformers import AutoModel, CLIPImageProcessor
model = AutoModel.from_pretrained(path_or_repo_id, trust_remote_code=True)
processor = CLIPImageProcessor.from_pretrained(path_or_repo_id)
The forward contract is intentionally server-friendly:
embeddings, _ = model(pixel_values)
What Is Included
configuration_personvit_reid.pymodeling_personvit_reid.pyconfig.jsonpreprocessor_config.jsonexport_personvit_reid.py
Intended Target
The default exporter preset is shaped for the planned first target:
- dataset:
MSMT17 - backbone class:
ViT-S - crop geometry:
128x256
Current Constraint
The repository does not include the original fine-tuned MSMT17 checkpoint. That means this scaffold can be validated locally with random weights today, but the final production export still requires the real PersonViT/TransReID checkpoint at export time.
Export
Random-weight validation scaffold:
python -m server.model_repos.personvit_reid.export_personvit_reid \
--output-dir /tmp/personvit-reid-msmt17-vit-s \
--init-random
Checkpoint-backed export:
python -m server.model_repos.personvit_reid.export_personvit_reid \
--output-dir /tmp/personvit-reid-msmt17-vit-s \
--checkpoint /path/to/checkpoint.pth
The exporter writes:
config.jsonpreprocessor_config.jsonconfiguration_personvit_reid.pymodeling_personvit_reid.pyREADME.mdmodel.safetensors
Notes
- This is intentionally a minimal inference package, not the upstream training tree.
- If the upstream checkpoint uses different tensor names, adapt the checkpoint
mapping in
export_personvit_reid.py. - The server integration can use
config.reid_target_sizeandconfig.reid_aspect_ratioto preserve person-style crop geometry.
- Downloads last month
- 315