🌎 GeoCLIP: Clip-Inspired Alignment between Locations and Images for Effective Worldwide Geo-localization
📍 Try out our demo! 
Description
GeoCLIP addresses the challenges of worldwide image geo-localization by introducing a novel CLIP-inspired approach that aligns images with geographical locations, achieving state-of-the-art results on geo-localization and GPS to vector representation on benchmark datasets (Im2GPS3k, YFCC26k, GWS15k, and the Geo-Tagged NUS-Wide Dataset). Our location encoder models the Earth as a continuous function, learning semantically rich, CLIP-aligned features that are suitable for geo-localization. Additionally, our location encoder architecture generalizes, making it suitable for use as a pre-trained GPS encoder to aid geo-aware neural architectures.
Method
Similarly to OpenAI's CLIP, GeoCLIP is trained contrastively by matching Image-GPS pairs. By using the MP-16 dataset, composed of 4.7M Images taken across the globe, GeoCLIP learns distinctive visual features associated with different locations on earth.
📎 Getting Started: API
GeoCLIP requires Python 3.11 or newer and Pillow 13.x. Pillow 13 fixes security vulnerabilities in TIFF decoding and PDF parsing. Python 3.10 users must upgrade Python to use the patched dependency.
You can install GeoCLIP's module using pip:
pip install geoclip
or directly from source:
git clone https://github.com/VicenteVivan/geo-clip
cd geo-clip
python -m pip install .
🗺️📍 Worldwide Image Geolocalization
Usage: GeoCLIP Inference
import torch
from geoclip import GeoCLIP
model = GeoCLIP()
image_path = "image.png"
top_pred_gps, top_pred_prob = model.predict(image_path, top_k=5)
print("Top 5 GPS Predictions")
print("=====================")
for i in range(5):
lat, lon = top_pred_gps[i]
print(f"Prediction {i+1}: ({lat:.6f}, {lon:.6f})")
print(f"Probability: {top_pred_prob[i]:.6f}")
print("")
🌐 Worldwide GPS Embeddings
In our paper, we show that once trained, our location encoder can assist other geo-aware neural architectures. Specifically, we explore our location encoder's ability to improve multi-class classification accuracy. We achieved state-of-the-art results on the Geo-Tagged NUS-Wide Dataset by concatenating GPS features from our pre-trained location encoder with an image's visual features. Additionally, we found that the GPS features learned by our location encoder, even without extra information, are effective for geo-aware image classification, achieving state-of-the-art performance in the GPS-only multi-class classification task on the same dataset.
Usage: Pre-Trained Location Encoder
import torch
from geoclip import LocationEncoder
gps_encoder = LocationEncoder()
gps_data = torch.Tensor([[40.7128, -74.0060], [34.0522, -118.2437]]) # NYC and LA in lat, lon
gps_embeddings = gps_encoder(gps_data)
print(gps_embeddings.shape) # (2, 512)
Acknowledgments
This project incorporates code from Joshua M. Long's Random Fourier Features Pytorch. For the original source, visit here.
Citation
If you find GeoCLIP beneficial for your research, please consider citing us with the following BibTeX entry:
@inproceedings{geoclip,
title={GeoCLIP: Clip-Inspired Alignment between Locations and Images for Effective Worldwide Geo-localization},
author={Vivanco, Vicente and Nayak, Gaurav Kumar and Shah, Mubarak},
booktitle={Advances in Neural Information Processing Systems},
year={2023}
}
Metadata
Release files for geoclip 1.3.0
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 |
|---|---|---|---|---|
| geoclip-1.3.0.tar.gz | 43.2 MB | With provenance | Details for geoclip-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geoclip-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for geoclip-1.3.0-py3-none-any.whl |
Total release size: 83.5 MB
Release files / geoclip-1.3.0.tar.gz
| Download URL | geoclip-1.3.0.tar.gz |
|---|---|
| Size | 43.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d03d3db3767ce3d6a98374ccfc14b2226faf353e64e7206947bcd74c50a83a6
|
|
BLAKE2b-256 checksum How to use checksums |
ef313fc54ffc3352677f1d8a83b159dce099abf56ea66964dbe52c66d87d94a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / geoclip-1.3.0-py3-none-any.whl
| Download URL | geoclip-1.3.0-py3-none-any.whl |
|---|---|
| Size | 40.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08a93791166a279d52b95c466a952c75f17f654cc61bdf6ab20355325b564dec
|
|
BLAKE2b-256 checksum How to use checksums |
1c07d2253a204731ef8d1b2f9d6acdeb66ae7a0ea2fee8b274626b2b29f73119
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for geoclip 1.3.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for geoclip-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA 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.