SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.16020 · NeurIPS · 2023

GeoCLIP: Clip-Inspired Alignment between Locations and Images for Effective Worldwide Geo-localization

Vicente Vivanco Cepeda, Kumar Gaurav, Mubarak Nayak, Shah

arXiv · PDF · Open in the Atlas

Code that ran

5 of 13 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 8 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2309.16020.json · badge: /api/ran/2309.16020.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
VicenteVivan/geo-clip marked official in Papers with Code
Papers with Code archive
5 ran · 3 no recorded run
ramanakshay/hierarchical-geoclip community
Papers with Code archive
0 ran · 5 no recorded run
FunctionStatusWhere it lives
ImageEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("0342fbed5f4dd6e2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, ImageEncoder: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from unittest.mock import Mock, MagicMock
import numpy as np

torch.manual_seed(0)

# Create a mock CLIPModel that doesn't require downloads
class MockCLIPModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.visual_projection = nn.Linear(768, 768)
    
    def get_image_features(self, pixel_values):
        # Return a tensor of shape (batch_size, 768)
        batch_size = pixel_values.shape[0]
        return torch.randn(batch_size, 768)
    
    def parameters(self):
        return super().parameters()

# Create a mock processor
class MockImageProcessor:
    def __call__(self, images=None, return_tensors=None):
        # Return pixel values of shape (batch_size, 3, 224, 224)
        if isinstance(images, list):
            batch_size = len(images)
        else:
            batch_size = 2
        return {
            'pixel_values': torch.randn(batch_size, 3, 224, 224)
        }

# Mock the from_pretrained methods to return our mock objects
original_clip_from_pretrained = None
original_processor_from_pretrained = None

def mock_clip_from_pretrained(model_name):
    return MockCLIPModel()

def mock_processor_from_pretrained(model_name):
    return MockImageProcessor()

# Patch the from_pretrained methods
import transformers
original_clip = transformers.CLIPModel.from_pretrained
original_proc = transformers.AutoProcessor.from_pretrained

transformers.CLIPModel.from_pretrained = staticmethod(mock_clip_from_pretrained)
transformers.AutoProcessor.from_pretrained = staticmethod(mock_processor_from_pretrained)

# Now we can safely import and instantiate ImageEncoder
# (it will use our mocked versions)
from transformers import AutoProcessor, CLIPModel

def _extract_image_features(output):
    """Return projected CLIP features across Transformers 4.x and 5.x."""
    if isinstance(output, torch.Tensor):
        return output
    pooled_output = getattr(output, 'pooler_output', None)
    if isinstance(pooled_output, torch.Tensor):
        return pooled_output
    if isinstance(output, (tuple, list)) and output and isinstance(output[0], torch.Tensor):
        return output[0]
    raise TypeError(f'CLIPModel.get_image_features returned an unsupported value of type {type(output).__name__}.')

class ImageEncoder(nn.Module):

    def __init__(self):
        super().__init__()
        self.CLIP = CLIPModel.from_pretrained('openai/clip-vit-large-patch14')
        self.image_processor = AutoProcessor.from_pretrained('openai/clip-vit-large-patch14')
        self.mlp = nn.Sequential(nn.Linear(768, 768), nn.ReLU(), nn.Linear(768, 512))
        for param in self.CLIP.parameters():
            param.requires_grad = False

    def preprocess_image(self, image):
        x = self.image_processor(images=image, return_tensors='pt')['pixel_values']
        return x

    def forward(self, x):
        x = _extract_image_features(self.CLIP.get_image_features(pixel_values=x))
        x = self.mlp(x)
        return x

# Create test inputs
# ImageEncoder takes no parameters in __init__
ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ImageEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ImageEncoder output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
LocationEncoderCapsule Ran
ran on a synthesized input · constructed an object; no result was computed
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("10336c7c42408bd3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LocationEncoderCapsule: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn, Tensor

torch.manual_seed(0)

# Mock the functional module since it's not provided
class functional:
    @staticmethod
    def sample_b(sigma, shape):
        """Sample b matrix from standard normal distribution"""
        return torch.randn(shape)
    
    @staticmethod
    def gaussian_encoding(v, b):
        """Apply random Fourier features encoding"""
        # v shape: (N, *, input_size)
        # b shape: (encoded_size, input_size)
        # output shape: (N, *, 2 * encoded_size)
        bv = torch.matmul(v, b.t())  # (N, *, encoded_size)
        cos_part = torch.cos(2 * torch.pi * bv)
        sin_part = torch.sin(2 * torch.pi * bv)
        return torch.cat([cos_part, sin_part], dim=-1)  # (N, *, 2 * encoded_size)

# Inject functional into the module namespace
import sys
current_module = sys.modules[__name__]
current_module.functional = functional

ARGS = {
    'sigma': 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LocationEncoderCapsule — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LocationEncoderCapsule output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
_extract_image_features Ran
ran, honoured the contract we drafted
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("193ffaf24c16bd61")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Test case 1: Direct tensor output
tensor_output = torch.randn(2, 4)
ARGS = {
    'output': tensor_output
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
equal_earth_projection Ran
ran, honoured the contract we drafted
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("0420b6ffe30c1b1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes L as input, which should be a tensor of shape (batch_size, 2)
# where each row contains [latitude, longitude] in degrees
L = torch.tensor([
    [45.0, -120.0],
    [-30.5, 60.25]
], dtype=torch.float32)

ARGS = {
    "L": L
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_gps_data Ran
ran, honoured the contract we drafted
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("59757f850bed5fc9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 2) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import pandas as pd
import tempfile
import os

torch.manual_seed(0)

# Create a temporary CSV file with GPS data
temp_dir = tempfile.mkdtemp()
csv_file = os.path.join(temp_dir, "gps_data.csv")

# Write sample GPS data to CSV
gps_data = pd.DataFrame({
    'LAT': [40.7128, 34.0522, 41.8781, 29.7604],
    'LON': [-74.0060, -118.2437, -87.6298, -95.3698]
})
gps_data.to_csv(csv_file, index=False)

ARGS = {
    'csv_file': csv_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 2) — shape (4, 2) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GaussianEncoding Not yet run
unverified (harvested, no recorded run)
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("88bf24771293c9e0")
How it ran

no invocation recorded.

GaussianEncoding Not yet run
unverified (harvested, no recorded run)
ramanakshay/hierarchical-geoclip/geoclip/model/geoclip.py
code served (permissive licence) · get_code("ae05a9ade5fb928f")
How it ran

no invocation recorded.

GeoCLIP Not yet run
unverified (harvested, no recorded run)
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("0db29c57e5099ec7")
How it ran

no invocation recorded.

GeoCLIP Not yet run
unverified (harvested, no recorded run)
ramanakshay/hierarchical-geoclip/geoclip/model/geoclip.py
code served (permissive licence) · get_code("7e8b0eadc545633d")
How it ran

no invocation recorded.

ImageEncoder Not yet run
unverified (harvested, no recorded run)
ramanakshay/hierarchical-geoclip/geoclip/model/geoclip.py
code served (permissive licence) · get_code("8f9ebe49ed62b249")
How it ran

no invocation recorded.

LocationEncoder Not yet run
unverified (harvested, no recorded run)
VicenteVivan/geo-clip/geoclip/model/GeoCLIP.py
code served (permissive licence) · get_code("ccb9f7466f37469c")
How it ran

no invocation recorded.

LocationEncoder Not yet run
unverified (harvested, no recorded run)
ramanakshay/hierarchical-geoclip/geoclip/model/geoclip.py
code served (permissive licence) · get_code("80221b8324d17fd9")
How it ran

no invocation recorded.

LocationEncoderCapsule Not yet run
unverified (harvested, no recorded run)
ramanakshay/hierarchical-geoclip/geoclip/model/geoclip.py
code served (permissive licence) · get_code("57f6ab5e0536c43d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
equal_earth_projection
brick of this paper's assembly: helper
1 other paper
1 later
2403.16831 (2024-03)
UrbanVLP: Multi-Granularity Vision-Language Pretraining for Urban Socioeconomic Indicator Prediction

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Worldwide Geo-localization aims to pinpoint the precise location of images taken anywhere on Earth. This task has considerable challenges due to the immense variation in geographic landscapes. The image-to-image retrieval-based approaches fail to solve this problem on a global scale as it is not feasible to construct a large gallery of images covering the entire world. Instead, existing approaches divide the globe into discrete geographic cells, transforming the problem into a classification task. However, their performance is limited by the predefined classes and often results in inaccurate localizations when an image's location significantly deviates from its class center. To overcome these limitations, we propose GeoCLIP, a novel CLIP-inspired Image-to-GPS retrieval approach that enforces alignment between the image and its corresponding GPS locations. GeoCLIP's location encoder models the Earth as a continuous function by employing positional encoding through random Fourier features and constructing a hierarchical representation that captures information at varying resolutions to yield a semantically rich highdimensional feature suitable to use even beyond geo-localization. To the best of our knowledge, this is the first work employing GPS encoding for geo-localization. We demonstrate the efficacy of our method via extensive experiments and ablations on benchmark datasets. We achieve competitive performance with just 20% of training data, highlighting its effectiveness even in limited-data settings. Furthermore, we qualitatively demonstrate geo-localization using a text query by leveraging the CLIP backbone of our image encoder. The project webpage is available at: https://vicentevivan.github.io/GeoCLIP

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2309.16020")
get_code_for_paper("2309.16020")
have("2309.16020")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2309.16020.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2309.16020.svg)](https://syntology.ai/paper/2309.16020)

Connect an agent — have() is free.