{"id":31186047,"url":"https://github.com/applied-machine-learning-lab/georanker","last_synced_at":"2026-02-12T09:33:52.279Z","repository":{"id":315450669,"uuid":"1059576840","full_name":"Applied-Machine-Learning-Lab/GeoRanker","owner":"Applied-Machine-Learning-Lab","description":"Code repository for paper \"GeoRanker: Distance-Aware Ranking for Worldwide Image Geolocalization\"","archived":false,"fork":false,"pushed_at":"2025-10-22T08:00:08.000Z","size":99525,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-22T10:04:28.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Applied-Machine-Learning-Lab.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T16:23:23.000Z","updated_at":"2025-10-22T08:00:11.000Z","dependencies_parsed_at":"2025-09-18T18:55:03.986Z","dependency_job_id":"3d97e706-73af-4d6e-bb84-1e06222fe9b3","html_url":"https://github.com/Applied-Machine-Learning-Lab/GeoRanker","commit_stats":null,"previous_names":["applied-machine-learning-lab/georanker"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Applied-Machine-Learning-Lab/GeoRanker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applied-Machine-Learning-Lab%2FGeoRanker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applied-Machine-Learning-Lab%2FGeoRanker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applied-Machine-Learning-Lab%2FGeoRanker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applied-Machine-Learning-Lab%2FGeoRanker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Applied-Machine-Learning-Lab","download_url":"https://codeload.github.com/Applied-Machine-Learning-Lab/GeoRanker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Applied-Machine-Learning-Lab%2FGeoRanker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29362851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2025-09-19T19:41:16.687Z","updated_at":"2026-02-12T09:33:52.275Z","avatar_url":"https://github.com/Applied-Machine-Learning-Lab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GeoRanker: Distance-Aware Ranking for Worldwide Image Geolocalization\n\nThis is the code, checkpoint, and dataset repository for `GeoRanker: Distance-Aware Ranking for Worldwide Image Geolocalization`\n\n## Environment\n\n```bash\nconda create -n georanker python=3.11\nconda activate georanker\n\n# Addtional modules\npip install git+https://github.com/huggingface/transformers accelerate\npip install qwen-vl-utils[decord]==0.0.8\npip install pandas geopy\npip install flash-attn --no-build-isolation\npip install scikit-learn deepspeed datasets peft torchvision wandb\nconda install mpi4py\n```\n\n**❗❗❗We also uploaded the YAML file for our environment, but the Transformers version used during our experiments was `4.52.0.dev0`. You may want to set it to a newer official version when running this repository.**\n\nOur environment is also available at [HuggingFace](https://huggingface.co/datasets/Jia-py/GeoRanker/tree/main), you can add it to your conda by:\n\n```bash\nmkdir -p ~/conda_path/envs/your_env_name\ntar -xzf georanker.tar.gz -C ~/conda_path/envs/your_env_name\n```\n\n## Quick Start\n\n### Run with your images (calculating rewards between a query and some candidates)\n\nplease first modify the image paths, candidate_gps_lis, gt_lat, and gt_lon in `quick_start.py` file, then run `python quick_start.py` to check the rewards and prediction.\n\n### Run with sampled im2gps3k data\n\nYou will need to first download the **mp16-pro** tar file and the **tar_index.pkl** file from [Hugging Face](https://huggingface.co/datasets/Jia-py/MP16-Pro). Additionally, please download the IM2GPS3K image dataset as described in the *Dataset* section. Then, modify the relevant paths in **quick_start_im2gps3k.py** and run `python quick_start_im2gps3k.py`.\n\n## Dataset\n\n### Evaluation Datasets\n\nIM2GPS3K: [images](http://www.mediafire.com/file/7ht7sn78q27o9we/im2gps3ktest.zip) and [metadata](https://raw.githubusercontent.com/TIBHannover/GeoEstimation/original_tf/meta/im2gps3k_places365.csv); YFCC4K: [images](http://www.mediafire.com/file/3og8y3o6c9de3ye/yfcc4k.zip) and [metadata](https://github.com/TIBHannover/GeoEstimation/releases/download/pytorch/yfcc25600_places365.csv); MP16-Pro: [Huggingface](https://huggingface.co/datasets/Jia-py/MP16-Pro)\n\nYou can also find the meta data for IM2GPS3K, YFCC4K, retrieval checkpoints of G3, retrieval index in [Huggingface](https://huggingface.co/Jia-py/G3-checkpoint)\n\n### GeoRanking Dataset\n\nWe have uploaded the dataset to `dataset/georanking`\n\n```python\ndataset = load_dataset(\"parquet\", data_files=\"path_to_file\", split=\"train\")\n\n\u003e\u003e\u003e dataset\nDataset({\n    features: ['img_id', 'gps', 'ref_gps', 'ref_img_id', 'ref_texts'],\n    num_rows: 100000\n})\n```\n\n* img_id: ID of query image in MP16-Pro dataset\n* gps: gps of query image\n* ref_gps: gps list for candidates\n* ref_img_id: image id list for candidates\n* ref_texts: textual descriptions list for candidates\n\n## Checkpoints\n\nThe lora weights are put under `checkpoints/`.\n\n## File Structure\n\n```\n.\n├── checkpoints/\n│   ├── adapter_config.json\n│   └── adapter_model.safetensors\n├── dataset/\n│   ├── im2gps3k/\n│   │   ├── im2gps3k.csv\n│   │   ├── im2gps3k_metadata_and_images_should_be_put_here\n│   │   └── I.npy -\u003e retrieval index results for im2gps3k\n│   ├── mp16-pro/\n│   │   └── mp16-pro_metadata_and_images_and_should_be_put_here\n│   └── yfcc4k/\n│       ├── yfcc4k.csv\n│       ├── yfcc4k_metadata_and_images_should_be_put_here\n│       └── I.npy -\u003e retrieval index results for yfcc4k\n├── deepspeed_config/\n│   └── zero2.json\n├── utils/\n│   └── geo_ranker.py -\u003e main file for georanker\n├── compile_prediction_candidates.py -\u003e compile retrieval and generated candidates to one file\n├── evaluate.py\n├── finetune_geo_ranker.py -\u003e script for training georanker\n├── environment.yml\n└── lvlm_zs_predict.py -\u003e script for generating candidates with lvlm\n```\n\nFor MP16-Pro dataset, please refer to [G3](https://arxiv.org/pdf/2405.14702).\n\n## Running\n\n1. Training GeoRanker\n\n   ```bash\n   CUDA_VISIBLE_DEVICES=0,1,2,3 deepspeed --num_gpus 4 finetune_geo_ranker.py --model_path=Qwen/Qwen2-VL-7B-Instruct --model_save_path=xxx --group_size=7\n   ```\n2. Generating candidates with LVLM\n\n   ```bash\n   python lvlm_zs_predict.py --api_key=sk-xxx --model_name=xxx --base_url=xxx --root_path=xxx/dataset/yfcc4k\n   ```\n3. Compiling generated and retrieval candidates to one file (we have uploaded the retrieval candidates and generated candidates for IM2GPS3K and YFCC4K under dataset folder). `We have uploaded the index file I.npy for IM2GPS3K and YFCC4K.`\n\n   ```bash\n   python compile_prediction_candidates.py\n   ```\n4. Evaluation\n\n   ```bash\n   # we recommend using larger batch size during inference\n   python evaluate.py --model_path=path_to_lora --dataset=im2gps3k --topn=12 --topn_zs=3 --batch_size=16\n   ```\n\n## Citation\n\nIf you find our work interesting or helpful, we would really appreciate it if you could give us a star.\n\n```\n@article{jia2025georanker,\n  title={GeoRanker: Distance-Aware Ranking for Worldwide Image Geolocalization},\n  author={Jia, Pengyue and Park, Seongheon and Gao, Song and Zhao, Xiangyu and Li, Yixuan},\n  journal={arXiv preprint arXiv:2505.13731},\n  year={2025}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplied-machine-learning-lab%2Fgeoranker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapplied-machine-learning-lab%2Fgeoranker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapplied-machine-learning-lab%2Fgeoranker/lists"}