{"id":15629845,"url":"https://github.com/ducha-aiki/affnet","last_synced_at":"2025-04-09T13:09:50.004Z","repository":{"id":43603454,"uuid":"111140917","full_name":"ducha-aiki/affnet","owner":"ducha-aiki","description":"Code and weights for local  feature affine shape estimation paper \"Repeatability Is Not Enough: Learning Discriminative Affine Regions via Discriminability\"","archived":false,"fork":false,"pushed_at":"2022-06-14T10:06:51.000Z","size":64223,"stargazers_count":271,"open_issues_count":3,"forks_count":47,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-02T07:01:36.274Z","etag":null,"topics":["affine-shape-estimator","computer-vision","convolutional-networks","convolutional-neural-networks","deep-learning","hessian","image-matching","image-retrieval","local-features","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-17T19:07:21.000Z","updated_at":"2025-03-06T16:16:56.000Z","dependencies_parsed_at":"2022-07-09T07:46:15.125Z","dependency_job_id":null,"html_url":"https://github.com/ducha-aiki/affnet","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%2Faffnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Faffnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Faffnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ducha-aiki%2Faffnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ducha-aiki","download_url":"https://codeload.github.com/ducha-aiki/affnet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"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":["affine-shape-estimator","computer-vision","convolutional-networks","convolutional-neural-networks","deep-learning","hessian","image-matching","image-retrieval","local-features","pytorch"],"created_at":"2024-10-03T10:29:17.237Z","updated_at":"2025-04-09T13:09:49.988Z","avatar_url":"https://github.com/ducha-aiki.png","language":"Python","readme":"# AffNet model implementation\nCNN-based affine shape estimator.\n\nAffNet model implementation in PyTorch for ECCV2018 paper \"[Repeatability Is Not Enough: Learning Discriminative Affine Regions via Discriminability](https://arxiv.org/abs/1711.06704)\"\n\n## Update: pytorch 1.4 version\n\nThe master branch is the one, which produced ECCV-paper results, python 2.7 and pytorch 0.4.0 \n\n[Here](https://github.com/ducha-aiki/affnet/tree/pytorch1-4_python3) is the one, which successfully runs on python 3.7, pytorch 1.4.0\n\nAffNet generates up to twice more correspondeces compared to Baumberg iterations\n![HesAff](imgs/graf16HesAff.jpg)\n![HesAffNet](imgs/graf16HesAffNet.jpg)\n\n\n## Retrieval on Oxford5k, mAP\n\n| Detector + Descriptor | BoW  |  BoW + SV | BoW + SV + QE | HQE + MA |\n| -----    | ----  |  ---- | ---- | ---- |\n| [HesAff](https://github.com/perdoch/hesaff) + [RootSIFT](http://ieeexplore.ieee.org/document/6248018/)    | 55.1  |  63.0 | 78.4 | 88.0 |\n| [HesAff](https://github.com/perdoch/hesaff) + [HardNet++](https://github.com/DagnyT/hardnet)   | 60.8  |  69.6 | 84.5 | 88.3 |\n| HesAffNet + [HardNet++](https://github.com/DagnyT/hardnet)   | **68.3**  |  **77.8** | **89.0** | **89.5** |\n\n## Datasets and Training\n\nTo download datasets and start learning affnet:\n\n```bash\ngit clone https://github.com/ducha-aiki/affnet\n./run_me.sh\n```\n\n## Paper figures reproduction\n\nTo reproduce Figure 1 in paper, run [notebook](examples/toy_example_figure1/Figure1.ipynb)\n\n\nTo reproduce Figure 2-3 in paper, run notebooks [here](examples/direct_shape_optimization)\n\n\n```bash\ngit clone https://github.com/ducha-aiki/affnet\n./run_me.sh\n```\n\n\n## Pre-trained models\n\nPre-trained models can be found in folder pretrained:  AffNet.pth\n\n## Usage example\n\nWe provide two examples, how to estimate affine shape with AffNet. \nFirst, on patch-column file, in [HPatches](https://github.com/hpatches/hpatches-benchmark) format, i.e. grayscale image with w = patchSize and h = nPatches * patchSize\n\n```\ncd examples/just_shape\npython detect_affine_shape.py imgs/face.png out.txt\n```\n\nOut file format is upright affine frame a11 0 a21 a22\n\n\nSecond, AffNet inside pytorch implementation of Hessian-Affine\n\n2000 is number of regions to detect.\n\n```\ncd examples/hesaffnet\npython hesaffnet.py img/cat.png ells-affnet.txt 2000\npython hesaffBaum.py img/cat.png ells-Baumberg.txt 2000\n```\n\noutput ells-affnet.txt is [Oxford affine](http://www.robots.ox.ac.uk/~vgg/research/affine/) format \n```\n1.0\n128\nx y a b c \n```\n\n## WBS example \n\n\nExample is in [notebook](examples/hesaffnet/WBS demo.ipynb)\n\n\n## Citation\n\nPlease cite us if you use this code:\n\n```\n@inproceedings{AffNet2017,\n author = {Dmytro Mishkin, Filip Radenovic, Jiri Matas},\n    title = \"{Repeatability Is Not Enough: Learning Discriminative Affine Regions via Discriminability}\",\n    year = 2018,\n    month = sep,\n    booktitle = {Proceedings of ECCV}\n    }\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducha-aiki%2Faffnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fducha-aiki%2Faffnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fducha-aiki%2Faffnet/lists"}