No project description provided
Project description
🌎 GeoMapCLIP: Clip-Inspired Alignment between Locations and Images for Effective Worldwide Geo-localization
Description
GeoMapCLIP 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, GeoMapCLIP is trained contrastively by matching Image-GPS pairs. By using the MP-16 dataset, composed of 4.7M Images taken across the globe, GeoMapCLIP learns distinctive visual features associated with different locations on earth.
🚧 Repo Under Construction 🔨
📎 Getting Started: API
You can install GeoMapCLIP's module using pip:
pip install geomapclip
or directly from source:
git clone https://github.com/junghawoo/geomap-clip
cd geomap-clip
python setup.py install
🗺️📍 Worldwide Image Geolocalization
Usage: GeoMapCLIP Inference
import torch
from geomapclip import GeoMapCLIP
model = GeoMapCLIP()
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 geomapclip 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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geomapclip-0.0.2.tar.gz.
File metadata
- Download URL: geomapclip-0.0.2.tar.gz
- Upload date:
- Size: 48.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be10b3d6ff8a0fe2bfb1aec60b4de6c932cd57082ca87fd44d717a3a9f8e8111
|
|
| MD5 |
ec81db1837fb5f559a63e8841920193d
|
|
| BLAKE2b-256 |
1316ca91ae628c5b53eeec4b83a7b143990869baa28e345e5cb0180db0f48db2
|
File details
Details for the file geomapclip-0.0.2-py3-none-any.whl.
File metadata
- Download URL: geomapclip-0.0.2-py3-none-any.whl
- Upload date:
- Size: 42.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f29919fa54a2b50006e253af7e16db91ad1001625618ebb824d8e3a50319958d
|
|
| MD5 |
d1685e9ff62b8aeeb8c129a61af98c64
|
|
| BLAKE2b-256 |
ce3ad60378fac6f2ba9e37529a3c6547cb7fb91b5e99d678316423db0beef836
|