{"id":13562260,"url":"https://github.com/ducha-aiki/pytorch-sift","last_synced_at":"2025-08-22T19:09:04.897Z","repository":{"id":71374293,"uuid":"89869120","full_name":"ducha-aiki/pytorch-sift","owner":"ducha-aiki","description":"PyTorch implementation of SIFT descriptor","archived":false,"fork":false,"pushed_at":"2019-08-22T10:44:48.000Z","size":1134,"stargazers_count":165,"open_issues_count":0,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-01-28T23:10:57.101Z","etag":null,"topics":["cnn","descriptor","image-matching","local-features","pytorch","sift"],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ducha-aiki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-04-30T18:29:05.000Z","updated_at":"2024-01-05T04:30:15.000Z","dependencies_parsed_at":"2023-04-10T21:18:00.331Z","dependency_job_id":null,"html_url":"https://github.com/ducha-aiki/pytorch-sift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Fpytorch-sift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Fpytorch-sift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Fpytorch-sift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Fpytorch-sift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducha-aiki","download_url":"https://codeload.github.com/ducha-aiki/pytorch-sift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248862820,"owners_count":21173891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","descriptor","image-matching","local-features","pytorch","sift"],"created_at":"2024-08-01T13:01:06.440Z","updated_at":"2025-04-14T10:33:19.198Z","avatar_url":"https://github.com/ducha-aiki.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","Paper implementations｜论文实现","Paper implementations"],"sub_categories":["Other libraries｜其他库:","Other libraries:"],"readme":"This is an differentiable [pytorch](https://github.com/pytorch/pytorch) implementation of SIFT patch descriptor. It is very slow for describing one patch, but quite fast for batch. It can be used for descriptop-based learning shape of affine feature.\n\n**UPD 08/2019** : pytorch-sift is added to [kornia](https://github.com/arraiyopensource/kornia) and available by `kornia.features.SIFTDescriptor`\n\nThere are different implementations of the SIFT on the web. I tried to match [Michal Perdoch implementation](https://github.com/perdoch/hesaff/blob/master/siftdesc.cpp), which gives high quality features for image retrieval [CVPR2009](http://cmp.felk.cvut.cz/~chum/papers/perdoch-cvpr09.pdf). However, on planar datasets, it is inferior to [vlfeat implementation](http://www.vlfeat.org/sandbox/api/sift.html).\nThe main difference is gaussian weighting window parameters, so I have made a vlfeat-like version too.  MP version weights patch center much more (see image below, left) and additionally crops everything outside the circular region. Right is vlfeat version\n\n\n![Michal Perdoch kernel](/img/mp_kernel.png)\n![vlfeat kernel](/img/vlfeat_kernel.png)\n\n\n\n```python\n\ndescriptor_mp_mode = SIFTNet(patch_size = 65,\n                        sigma_type= 'hesamp',\n                        masktype='CircularGauss')\n\ndescriptor_vlfeat_mode = SIFTNet(patch_size = 65,\n                        sigma_type= 'vlfeat',\n                        masktype='Gauss')\n\n```\nResults:\n\n![hpatches mathing results](/img/hpatches-results.png)\n\n\n```\nOPENCV-SIFT - mAP \n   Easy     Hard      Tough     mean\n-------  -------  ---------  -------\n0.47788  0.20997  0.0967711  0.26154\n\nVLFeat-SIFT - mAP \n    Easy      Hard      Tough      mean\n--------  --------  ---------  --------\n0.466584  0.203966  0.0935743  0.254708\n\nPYTORCH-SIFT-VLFEAT-65 - mAP \n    Easy      Hard      Tough      mean\n--------  --------  ---------  --------\n0.472563  0.202458  0.0910371  0.255353\n\nNUMPY-SIFT-VLFEAT-65 - mAP \n    Easy      Hard      Tough      mean\n--------  --------  ---------  --------\n0.449431  0.197918  0.0905395  0.245963\n\nPYTORCH-SIFT-MP-65 - mAP \n    Easy      Hard      Tough      mean\n--------  --------  ---------  --------\n0.430887  0.184834  0.0832707  0.232997\n\nNUMPY-SIFT-MP-65 - mAP \n    Easy     Hard      Tough      mean\n--------  -------  ---------  --------\n0.417296  0.18114  0.0820582  0.226832\n\n\n```\n    \nSpeed: \n- 0.00246 s per 65x65 patch - [numpy SIFT](https://github.com/ducha-aiki/numpy-sift)\n- 0.00028 s per 65x65 patch - [C++ SIFT](https://github.com/perdoch/hesaff/blob/master/siftdesc.cpp)\n- 0.00074 s per 65x65 patch - CPU, 256 patches per batch\n- 0.00038 s per 65x65 patch - GPU (GM940, mobile), 256 patches per batch\n- 0.00038 s per 65x65 patch - GPU (GM940, mobile), 256 patches per batch\n\n\n\n\nIf you use this code for academic purposes, please cite the following paper:\n\n```\n@InProceedings{AffNet2018,\n    title = {Repeatability Is Not Enough: Learning Affine Regions via Discriminability},\n    author = {Dmytro Mishkin, Filip Radenovic, Jiri Matas},\n    booktitle = {Proceedings of ECCV},\n    year = 2018,\n    month = sep\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducha-aiki%2Fpytorch-sift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducha-aiki%2Fpytorch-sift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducha-aiki%2Fpytorch-sift/lists"}