#350 · Primary category: Computer Vision

hardnet

computer-vision convolutional-neural-networks deep-learning image-matching image-retrieval metric-learning nips-2017 pytorch

Hardnet descriptor model - "Working hard to know your neighbor's margins: Local descriptor learning loss"

Project last updated:04/14/25

GitHub Stars

534

Forks

101

Contributors

5

License

MIT

Why we included this project

HardNet is a PyTorch implementation of a local image descriptor trained with a margin-based loss that pulls each patch toward its nearest matching neighbor and pushes it away from the closest non-matching one. If you work on structure-from-motion, visual localization, or image retrieval, it's a practical alternative to hand-crafted descriptors like SIFT, with pretrained weights that beat classic baselines on HPatches and Oxford5k in the repo's own benchmarks. The repository includes training scripts, optional shift and rotation augmentation, and a notebook that shows how to compile the model to TorchScript for use from C++ code, which makes it easier to drop into a production pipeline. One thing to watch: the code is written for Python 2.7, so you'll likely need to port it if your stack is modern.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category