Model or dataset
VicenteVivan/geo-clip avatar
VicenteVivan/geo-clip

GeoCLIP: A Location Encoder and Image-to-GPS Predictor You Install From PyPI

This is an official PyTorch implementation of our NeurIPS 2023 paper "GeoCLIP: Clip-Inspired Alignment between Locations and Images for Effective Worldwide Geo-localization"

396 stars50 forksPythonMIT

At a glance

What is it?
GeoCLIP is the official PyTorch implementation of a NeurIPS 2023 paper that aligns images with GPS coordinates contrastively. It ships as a pip-installable package with two entry points: an image-to-GPS predictor and a standalone 512-dimensional location encoder.
Who is it for?
Adopt GeoCLIP if you need a pretrained image-to-GPS predictor or a 512-dimensional GPS embedding to concatenate onto an existing geo-aware classifier, and you are willing to accept the MP-16 training distribution as-is. Do not adopt it if you need a maintained, actively developed library: the README still carries a repo-under-construction notice, and the last push dates to 2026-09-03.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 12 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The gap GeoCLIP fills: coordinates as a differentiable output, not a classification label

Most image geolocalization models treat the problem as classification over a fixed grid of cells or a set of countries. That design caps accuracy at the resolution of the grid and makes the model awkward to reuse for anything except the exact label set it was trained on. GeoCLIP takes the opposite route. The README states that its location encoder models the Earth as a continuous function, and the paper title describes the training objective as CLIP-inspired alignment between locations and images. So the output space is continuous latitude and longitude, and the image encoder and location encoder are trained contrastively by matching Image-GPS pairs drawn from MP-16, a dataset the README describes as 4.7M images taken across the globe. The intended user is a researcher or engineer who wants either a ready image-to-GPS predictor or, more interestingly, a pretrained GPS encoder that can be concatenated with visual features in a downstream geo-aware architecture. The README reports that concatenating GPS features with visual features reached state-of-the-art results on the Geo-Tagged NUS-Wide Dataset, and that the GPS features alone were effective for GPS-only multi-class classification on the same dataset. Those are paper claims, not independent reproductions.

How the contrastive alignment works and what the two public classes expose

The mechanism visible in the material is a two-tower setup trained with a CLIP-style contrastive objective over image-GPS pairs. One tower encodes the image; the other, the LocationEncoder, maps a latitude and longitude pair into a 512-dimensional vector. Training pulls matched image-GPS pairs together in that shared space and pushes mismatched pairs apart. At inference the model does not regress coordinates directly. The README example shows model.predict(image_path, top_k=5) returning top_pred_gps and top_pred_prob, which means the prediction step ranks candidate locations and returns the top k with associated probabilities. That is a retrieval or ranking formulation rather than a regression head, and it is consistent with the contrastive training objective. The second public class, LocationEncoder, is usable on its own. The README example feeds a torch.Tensor of shape (2, 2) containing NYC and LA coordinates and prints an embedding shape of (2, 512). That shape is the interface contract: batch of lat/lon pairs in, 512 floats per location out. The README credits Joshua M. Long's Random Fourier Features PyTorch project as incorporated code, which is the likely source of the positional encoding used to make the Earth a continuous function rather than a lookup table.

Installing and calling it: the exact commands and keys in the README

Installation is either from PyPI with pip install geoclip, or from source with git clone https://github.com/VicenteVivan/geo-clip, cd geo-clip, then python -m pip install . The inference path is short. Import GeoCLIP from the geoclip package, instantiate it with no arguments, and call predict on an image path with top_k set. The README's example uses top_k=5 and then loops over the returned arrays, unpacking each entry as lat, lon and formatting the probability to six decimal places. The embedding path is equally short: import LocationEncoder, instantiate it, build a torch.Tensor of latitude and longitude pairs, and call the encoder on that tensor. Note what is absent from the material. The README does not document any configuration keys, environment variables, or constructor arguments for either class, and it does not state which checkpoint is downloaded, from where, or how large it is. The no-argument constructor implies weights are fetched or bundled at import or instantiation time, but the README does not say which. If you are deploying this in an air-gapped environment, that is the first thing you have to establish from the source, not from the documentation.

The training distribution is the ceiling, and the README does not address it

GeoCLIP learns from MP-16, described in the README as 4.7M images taken across the globe. Worldwide coverage in aggregate does not mean uniform coverage. Any contrastive model trained on a web-scraped photo corpus inherits the geographic skew of that corpus, and the README offers no per-region accuracy breakdown, no discussion of rural or polar performance, and no failure analysis. The paper is the place to look for that, and the README does not summarize it. There is a second limitation in the API surface itself. predict returns top_k candidates with probabilities, so the model always produces a ranked answer. There is no documented abstain path, no confidence threshold, and no way to ask the model whether the image is out of distribution. For a downstream system that needs to know when the prediction is untrustworthy, you have to construct that logic yourself from the probability values, and the README gives no guidance on what a meaningful cutoff looks like. A third constraint is operational: the README carries a repo-under-construction notice, which is an honest signal that parts of the project may be incomplete or in flux.

Where GeoCLIP is the wrong tool, and what to use instead

If your problem is fine-grained localization within a known city, within a known building, or along a known route, GeoCLIP is the wrong shape of tool. It is built for worldwide geolocalization, and its contrastive objective operates over the whole planet, so the resolution you get is the resolution the training signal supports. For street-level or indoor work, a retrieval system over a geotagged reference database is a better fit, because it matches against actual nearby images rather than against a global embedding space. The difference in approach is concrete: GeoCLIP compresses location into a learned 512-dimensional vector and compares image embeddings against it, while retrieval keeps the reference images and does nearest-neighbor search in image-embedding space, so its accuracy degrades gracefully as you add local data and it can tell you which reference image matched. The trade-off runs the other way too. Retrieval needs a dense, geotagged image index covering your target area, which is exactly what GeoCLIP avoids needing at inference time. If you have no local imagery but need global coverage, GeoCLIP is the more practical choice. If you have local imagery and need precision, retrieval wins.

Maintenance, upgrades and the MIT licence in practice

The repository is not archived, the most recent release is v1.2.1 dated 2026-09-03, and the last push timestamp matches the same day. That pattern, a release and a push on the same date, suggests the project is maintained in bursts rather than continuously, which is typical of academic code tied to a paper. Plan for that: pin the version you install rather than tracking the default branch, because a burst of changes after a long quiet period is the moment an unannounced API change is most likely to land. The licence is MIT, which is permissive and permits commercial use, modification, and redistribution provided the copyright notice and permission notice are retained. That is a description of the licence text, not legal advice, and the repository incorporates code from a third-party project (Random Fourier Features PyTorch) whose own licence terms you should confirm before redistributing. The README does not state the licence of that incorporated code. There is also no documented upgrade path, no changelog in the material, and no deprecation policy, so version-to-version compatibility of the GeoCLIP and LocationEncoder constructors is something you verify by reading the release notes and diffing the source, not by trusting a migration guide.

What to verify before you depend on it

Run the README's two examples unchanged first. The predict call with top_k=5 on the demo image, and the LocationEncoder call on a (2, 2) tensor that should print (2, 512). If either fails, the problem is installation or weights, not your integration. Then check the things the README leaves open: where the checkpoint comes from, how large it is, and whether the constructor accepts any argument that changes it. For the embedding use case, confirm that the 512-dimensional output is stable across calls and that the encoder is in eval mode, since the README example does not call .eval() or wrap anything in torch.no_grad(). For production image-to-GPS, collect your own images from the regions you actually care about and look at the returned probabilities before you set any threshold, because the README provides no calibration data and the paper's benchmark results on Im2GPS3k, YFCC26k, GWS15k and Geo-Tagged NUS-Wide are not a substitute for measuring on your distribution.

Editorial conclusion

Adopt GeoCLIP if you need a pretrained image-to-GPS predictor or a 512-dimensional GPS embedding to concatenate onto an existing geo-aware classifier, and you are willing to accept the MP-16 training distribution as-is. Do not adopt it if you need a maintained, actively developed library: the README still carries a repo-under-construction notice, and the last push dates to 2026-09-03. Before committing, verify that the v1.2.1 wheel installs cleanly on your Python and PyTorch versions, that the checkpoint download succeeds from your network, and that predict() returns probabilities you can threshold on your own images rather than the demo image.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. VicenteVivan/geo-clip on GitHub
Community notes

Community notes