{"id":18696917,"url":"https://github.com/vra/dinov2-retrieval","last_synced_at":"2025-04-12T07:31:44.334Z","repository":{"id":177909266,"uuid":"660865513","full_name":"vra/dinov2-retrieval","owner":"vra","description":"A cli program of image retrieval using dinov2","archived":false,"fork":false,"pushed_at":"2023-07-08T06:42:21.000Z","size":574,"stargazers_count":66,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T02:51:13.070Z","etag":null,"topics":["ai","computer-vision","deep-learning","dinov2","image-retrieval","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/vra.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-01T04:12:12.000Z","updated_at":"2025-02-03T10:02:21.000Z","dependencies_parsed_at":"2023-07-10T23:15:55.359Z","dependency_job_id":null,"html_url":"https://github.com/vra/dinov2-retrieval","commit_stats":null,"previous_names":["vra/dinov2-retrieval"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vra%2Fdinov2-retrieval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vra%2Fdinov2-retrieval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vra%2Fdinov2-retrieval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vra%2Fdinov2-retrieval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vra","download_url":"https://codeload.github.com/vra/dinov2-retrieval/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248533815,"owners_count":21120166,"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":["ai","computer-vision","deep-learning","dinov2","image-retrieval","pytorch"],"created_at":"2024-11-07T11:21:50.575Z","updated_at":"2025-04-12T07:31:44.325Z","avatar_url":"https://github.com/vra.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dinov2-retrieval\nA program of image retrieval using dinov2\n\nSome random results(left: query image, others: retrieved image from [Caltech 256](https://data.caltech.edu/records/nyy15-4j048)):\n![](./imgs/1688175364717_output.jpg)\n![](./imgs/1688175364731_output.jpg)\n![](./imgs/1688175364741_output.jpg)\n![](./imgs/1688175364753_output.jpg)\n![](./imgs/1688175364766_output.jpg)\n![](./imgs/1688175364775_output.jpg)\n![](./imgs/1688175364786_output.jpg)\n![](./imgs/1688175364801_output.jpg)\n![](./imgs/1688219476149_output.jpg)\n![](./imgs/1688219476156_output.jpg)\n\n## How to install\n```bash\npip install dinov2_retrieval\n```\nTested on:\n+ MacOS 13.4\n+ Windows 11\n+ Ubuntu 20.04\n\n## How to use\n\nAll available options:\n```bash\n$ dinov2_retrieval -h\nusage: dinov2_retrieval [-h] [-s {small,base,large,largest}] [-p MODEL_PATH] [-o OUTPUT_ROOT] -q QUERY -d DATABASE [-n NUM] [--size SIZE]\n                        [-m {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100}] [--disable-cache] [-v]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s {small,base,large,largest}, --model-size {small,base,large,largest}\n                        DinoV2 model type\n  -p MODEL_PATH, --model-path MODEL_PATH\n                        path to dinov2 model, useful when github is unavailable\n  -o OUTPUT_ROOT, --output-root OUTPUT_ROOT\n                        root folder to save output results\n  -q QUERY, --query QUERY\n                        path to a query image file or image folder\n  -d DATABASE, --database DATABASE\n                        path to the database image file or image folder\n  -n NUM, --num NUM     How many images to show in retrieval results\n  --size SIZE           image output size\n  -m {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100}, --margin {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100}\n                        margin size (in pixel) between concatenated images\n  --disable-cache       don't cache database features, will extract features each time, quite time-consuming for large database\n  -v, --verbose         show detailed logs\n```\n\nGenerally, You only need to set `-q` (or `--query`) and `-d` (or `--database`) to run this program:\n```bash\ndinov2_retrieval -q /path/to/query/image -d /path/to/database\n```\nNOTE: both of them can be path to an image or a folder.\n\nThe results will be saved to `output` folder.\n\n### Debug info\nadd `-v` or `--verbose` to show debug info\n\n### Change model size\nDINOv2 contains 4 types of pretrained models, you can use `--model_size` + one of [small, base, large, largest] to choose which model to use.\n\n### Use cached model\nIf the network to GitHub (where the DINOv2 models are stored) is unstable, you can set `--model-path` to cached model folder after downloading model during the first run.\n\n\n## TODO\n+ [ ]. optimize visualization result, e.g., better background color\n+ [ ]. More tech details\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvra%2Fdinov2-retrieval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvra%2Fdinov2-retrieval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvra%2Fdinov2-retrieval/lists"}