Person Re-Identification Model (ArcFace + DINOv2)
Fine-tuned DINOv2-base with ArcFace loss for person re-identification.
Model Description
- Base Model: DINOv2-ViT-B/14 (facebook/dinov2-base)
- Loss Function: ArcFace (Additive Angular Margin)
- Embedding Dimension: 768
- ArcFace Margin: 0.5
- Training Classes: 15
- Validation Accuracy: 90.12%
Usage
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import transforms
from PIL import Image
from huggingface_hub import hf_hub_download
# Download model
model_path = hf_hub_download(repo_id="DavronSherbaev/person-reid-arcface", filename="arcface_dinov2.pth")
# Load checkpoint
checkpoint = torch.load(model_path, map_location='cpu')
# Create model (see full code in repo)
# model = ArcFaceReID(...)
# model.load_state_dict(checkpoint['model_state_dict'])
# Extract embedding
# embedding = model.get_embedding(image_tensor)
Training Details
- Dataset: Custom person crops with bbox augmentation (scales: 90%, 100%, 120%)
- Train Samples: ~7,000 (augmented)
- Val Samples: 334 (clean, no augmentation)
- Epochs: 50
- Learning Rate: 3e-6 with cosine annealing
- Batch Size: 48
- Optimizer: AdamW
- Hardware: NVIDIA RTX 3080 Ti
Intended Use
Person re-identification in office/workplace environments. Designed to identify known individuals from camera feeds.
Limitations
- Trained on specific office environment
- Best for similar lighting/camera conditions
- Not suitable for face recognition (uses full body)
License
MIT
- Downloads last month
- 4