Official implementation of the paper "Turning Generators into Retrievers: Unlocking MLLMs for Natural Language-Guided Geo-Localization"
Python
5
20 commits
updated Jul 22, 2026
Official implementation of "Turning Generators into Retrievers: Unlocking MLLMs for Natural Language-Guided Geo-Localization" (CVPR 2026, Findings).
This repository provides a framework for leveraging Multimodal Large Language Models (MLLMs) for precise, natural language-guided geo-localization by transforming generative capabilities into retrieval strengths. Checkpoint weights are avaiable in the Preparation section.
.
βββ train.py # Main training for model training and fine-tuning
βββ eva.py # Evaluation for CVGText and GeoText
βββ eva_compute.py # (GeoText only) Large-scale metric calculator
βββ src/ # Core source: model definitions, losses, data utilities
βββ config/ # YAML configs for each model architecture
βββ internvl.yaml
βββ smolvlm.yaml
eva_compute.pyis required for GeoText evaluation. Running metric computation insideeva.pyon the full GeoText split will cause Out-Of-Memory (OOM) errors on standard GPUs.
conda create -n ngcg python=3.10
conda activate ngcg
pip install -r requirements.txt
Organize your data directory as follows:
data/
βββ CVGText/
β βββ images/
β β βββ <city>/
β βββ texts/
β β βββ <city>/
β βββ text2sate_<city>_train.json
β βββ text2sate_<city>_test.json
β βββ text2osm_<city>_train.json
β βββ text2osm_<city>_test.json
βββ GeoText/
βββ images/
β βββ train/
β βββ test/
βββ geo_t2i_train.json
βββ geo_t2i_test.json
All JSON files follow the original dataset author's format. We augment each entry with four additional fields to unify the retrieval pipeline β see Configuration & Data Fields for details. We also provide the processed JSON documents via this OneDrive folder with Code:123456
checkpoint for InternVL (including GeoText and CVGText) can be download via this OneDrive link with Code: 123456
Submit a training job on a SLURM-managed cluster:
sbatch train_internvl_geo.sh
Evaluation is handled differently depending on dataset scale.
eva.py runs inference and computes metrics in a single pass:
python eva.py \
--config_path <path/to/config.yaml> \
--checkpoint_to_eval <path/to/checkpoint> \
--dataset_name CVGText \
--subset_name vec_text2sate_newyork \
--augmentation 'none'
Due to the scale of GeoText, evaluation is split into two stages.
Stage 1 β Extract Features
python eva.py \
--config_path <path/to/config.yaml> \
--checkpoint_to_eval <path/to/checkpoint> \
--dataset_name GeoText \
--task text2image \
--subset_name geo_24G_t2i \
--augmentation 'none'
Stage 2 β Compute Recall@K Metrics
python eva_compute.py \
--checkpoint_to_eval <path/to/checkpoint> \
--dataset GeoText \
--subset geo_t2i \
--task image2text
We augment JSON annotation files with four additional fields to support the our framework. If the query is text-to-image, you would feed the text into qry_text_field and the corresponding ground-truth image into pos_img_path_field.
| Field | Description |
|---|---|
qry_text_field | Natural language query description. |
qry_img_path_field | Path to the query image (if applicable). |
pos_text_field | Text field of the positive (ground-truth) pair. |
pos_img_path_field | Path to the ground-truth target image. |
These fields are consistent across both CVGText and GeoText and are required for the data loader to function correctly.
If you find this work useful, please cite:
@inproceedings{chen2026turning,
title = {Turning Generators into Retrievers: Unlocking MLLMs for Natural Language-Guided Geo-Localization},
author = {Yuqi Chen and Xiaohan Zhang and Ahmad Arrabi and Waqas Sultani and Chen Chen and Safwan Wshah},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings},
year = {2026}
}
For questions about the paper or code, please open a GitHub issue or contact Yuqi Chen by email [email protected].
Official implementation of the paper "Turning Generators into Retrievers: Unlocking MLLMs for Natural Language-Guided Geo-Localization"
Python
5
20 commits
updated Jul 22, 2026
Official implementation of "Turning Generators into Retrievers: Unlocking MLLMs for Natural Language-Guided Geo-Localization" (CVPR 2026, Findings).
This repository provides a framework for leveraging Multimodal Large Language Models (MLLMs) for precise, natural language-guided geo-localization by transforming generative capabilities into retrieval strengths. Checkpoint weights are avaiable in the Preparation section.
.
βββ train.py # Main training for model training and fine-tuning
βββ eva.py # Evaluation for CVGText and GeoText
βββ eva_compute.py # (GeoText only) Large-scale metric calculator
βββ src/ # Core source: model definitions, losses, data utilities
βββ config/ # YAML configs for each model architecture
βββ internvl.yaml
βββ smolvlm.yaml
eva_compute.pyis required for GeoText evaluation. Running metric computation insideeva.pyon the full GeoText split will cause Out-Of-Memory (OOM) errors on standard GPUs.
conda create -n ngcg python=3.10
conda activate ngcg
pip install -r requirements.txt
Organize your data directory as follows:
data/
βββ CVGText/
β βββ images/
β β βββ <city>/
β βββ texts/
β β βββ <city>/
β βββ text2sate_<city>_train.json
β βββ text2sate_<city>_test.json
β βββ text2osm_<city>_train.json
β βββ text2osm_<city>_test.json
βββ GeoText/
βββ images/
β βββ train/
β βββ test/
βββ geo_t2i_train.json
βββ geo_t2i_test.json
All JSON files follow the original dataset author's format. We augment each entry with four additional fields to unify the retrieval pipeline β see Configuration & Data Fields for details. We also provide the processed JSON documents via this OneDrive folder with Code:123456
checkpoint for InternVL (including GeoText and CVGText) can be download via this OneDrive link with Code: 123456
Submit a training job on a SLURM-managed cluster:
sbatch train_internvl_geo.sh
Evaluation is handled differently depending on dataset scale.
eva.py runs inference and computes metrics in a single pass:
python eva.py \
--config_path <path/to/config.yaml> \
--checkpoint_to_eval <path/to/checkpoint> \
--dataset_name CVGText \
--subset_name vec_text2sate_newyork \
--augmentation 'none'
Due to the scale of GeoText, evaluation is split into two stages.
Stage 1 β Extract Features
python eva.py \
--config_path <path/to/config.yaml> \
--checkpoint_to_eval <path/to/checkpoint> \
--dataset_name GeoText \
--task text2image \
--subset_name geo_24G_t2i \
--augmentation 'none'
Stage 2 β Compute Recall@K Metrics
python eva_compute.py \
--checkpoint_to_eval <path/to/checkpoint> \
--dataset GeoText \
--subset geo_t2i \
--task image2text
We augment JSON annotation files with four additional fields to support the our framework. If the query is text-to-image, you would feed the text into qry_text_field and the corresponding ground-truth image into pos_img_path_field.
| Field | Description |
|---|---|
qry_text_field | Natural language query description. |
qry_img_path_field | Path to the query image (if applicable). |
pos_text_field | Text field of the positive (ground-truth) pair. |
pos_img_path_field | Path to the ground-truth target image. |
These fields are consistent across both CVGText and GeoText and are required for the data loader to function correctly.
If you find this work useful, please cite:
@inproceedings{chen2026turning,
title = {Turning Generators into Retrievers: Unlocking MLLMs for Natural Language-Guided Geo-Localization},
author = {Yuqi Chen and Xiaohan Zhang and Ahmad Arrabi and Waqas Sultani and Chen Chen and Safwan Wshah},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Findings},
year = {2026}
}
For questions about the paper or code, please open a GitHub issue or contact Yuqi Chen by email [email protected].