Around the World in 80 Timesteps:
A Generative Approach to Global Visual Geolocation
Nicolas Dufour, David Picard, Vicky Kalogeiton, Loic Landrieu
Introducing the first generative geolocation method based on diffusion and flow matching! We learn the relationship between visual content and location by denoising random locations conditionally to images.
➜ New SOTA for visual geolocation on OpenStreetView-5M, YFCC-100M, and iNat-21
➜ Generate global probability density maps and quantify localizability
➜ Introduce the problem of probabilistic visual geolocation
This repository contains the code for the paper "Around the World in 80 Timesteps: A Generative Approach to Global Visual Geolocation"
Project website: https://nicolas-dufour.github.io/plonk
Arxiv: https://arxiv.org/abs/2412.06781
HuggingFace Collection: https://huggingface.co/collections/nicolas-dufour/around-the-world-in-80-timesteps-6758595d634129e6fc63dad9
Demo: https://huggingface.co/spaces/nicolas-dufour/PLONK
Installation
If you want to use our models, you can directly install the diff-plonk package:
conda create -n plonk python=3.10
conda activate plonk
pip install diff-plonk
For a local installation, if you want to train the model or use the demo, you can clone the repository and install the dependencies:
From the github repository:
git clone https://github.com/nicolas-dufour/plonk.git
cd plonk
conda create -n plonk python=3.10
conda activate plonk
pip install -e .
From pip:
conda create -n plonk python=3.10
conda activate plonk
pip install diff-plonk
Models
We provide pre-trained models for the OSV-5M, YFCC-100M, and iNat-21 datasets. You can download them from the huggingface hub.
Demo
We provide a demo of the model hosted on the following HuggingFace Space.
Running the demo locally
pip install -e ".[demo]"
And then run the following command:
streamlit run plonk/demo/demo.py
Usage
To use the models, you can use our pipeline:
from plonk import PlonkPipeline
pipeline = PlonkPipeline("nicolas-dufour/PLONK_YFCC")
gps_coords = pipeline(images, batch_size=1024)
With images being a list of PIL images or a PIL image.
3 different models are provided for each dataset:
nicolas-dufour/PLONK_OSV_5M: OSV-5Mnicolas-dufour/PLONK_YFCC: YFCC-100Mnicolas-dufour/PLONK_iNat: iNat-21
Baselines models
We also provide the baseline models for the OSV-5M, YFCC-100M, and iNat-21 datasets for the carthesian flow matching and diffusion models. You can download them from the huggingface hub.
Flow matching models:
nicolas-dufour/PLONK_OSV_5M_flow: OSV-5Mnicolas-dufour/PLONK_YFCC_flow: YFCC-100Mnicolas-dufour/PLONK_iNat_flow: iNat-21
Diffusion models:
nicolas-dufour/PLONK_OSV_5M_diffusion: OSV-5Mnicolas-dufour/PLONK_YFCC_diffusion: YFCC-100Mnicolas-dufour/PLONK_iNat_diffusion: iNat-21
Training
Install training dependencies
You will need to install the training dependencies:
pip install -e ".[train]"
Downloading the dataset
You will need to download the OSV5M webdataset from the https://huggingface.co/datasets/osv5m/osv5m-wds in the plonk/datasets/osv5m folder.
Training the model
To train the model, you can use the following command:
python plonk/train.py exp=osv_5m_geoadalnmlp_r3_small_sigmoid_flow_riemann mode=traineval experiment_name=My_OSV_5M_Experiment
Evaluating the model
To evaluate the model, you can use the following command:
python plonk/train.py exp=osv_5m_geoadalnmlp_r3_small_sigmoid_flow_riemann mode=eval experiment_name=My_OSV_5M_Experiment
YFCC and iNAturalist
For YFCC and iNat, script to preprocess the dataset are provided in the plonk/data/extract_embeddings and plonk/data/to_webdataset folders.
Citation
If you find this work useful for your research or use our code, please cite our paper:
@article{dufour2024around,
title={Around the World in 80 Timesteps: A Generative Approach to Global Visual Geolocation},
author={Dufour, Nicolas and Picard, David and Kalogeiton, Vicky and Landrieu, Loic},
journal={arXiv preprint arXiv:2412.06781},
year={2024}
}
Metadata
Release files for diff-plonk 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| diff_plonk-0.4.tar.gz | 54.4 kB | Without provenance | Details for diff_plonk-0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| diff_plonk-0.4-py3-none-any.whl | Python 3 | none | any | Details for diff_plonk-0.4-py3-none-any.whl |
Total release size: 126.5 kB
Release files / diff_plonk-0.4.tar.gz
| Download URL | diff_plonk-0.4.tar.gz |
|---|---|
| Size | 54.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b59c9f707d71d445f4ccd3a9807e48539b9f4d5ed5a02d312b0f3a3aa1ee960
|
|
BLAKE2b-256 checksum How to use checksums |
f1eddacb610a67d0a3a7fb2031a88cf9069a2408af38c758d02d5a1fe8820f64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.16
|
Release files / diff_plonk-0.4-py3-none-any.whl
| Download URL | diff_plonk-0.4-py3-none-any.whl |
|---|---|
| Size | 72.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d229d146e465957f887ff95f94ce614f9a37b13c6670dcfd3a352794014fe3e
|
|
BLAKE2b-256 checksum How to use checksums |
bb7d3a7e94c713962002eaf95870113d9551a10c5ac809317b9914ef4d5271a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.16
|
Security for diff-plonk 0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.