KevinMusgrave/pytorch-metric-learning
The easiest way to use deep metric learning in your application. Modular, flexible, and extensible. Written in PyTorch.
Provides 9 independent modules—including loss functions (TripletMarginLoss, ArcFaceLoss, etc.), hard pair miners, distance metrics, and reducers—that compose into customizable training pipelines. Automatically converts between triplet and pair representations, supports self-supervised learning via augmentation pairs, and includes built-in trainers and evaluation utilities for metric learning workflows. Integrates seamlessly with standard PyTorch training loops and includes pre-built dataset loaders for common benchmarks like CUB-200 and Stanford Online Products.
6,312 stars and 5,671,502 monthly downloads. Used by 5 other packages. No commits in the last 6 months. Available on PyPI.
Stars
6,312
Forks
663
Language
Python
License
MIT
Category
Last pushed
Aug 17, 2025
Monthly downloads
5,671,502
Commits (30d)
0
Dependencies
4
Reverse dependents
5
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/ml-frameworks/KevinMusgrave/pytorch-metric-learning"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.