Downloads · 30 days
23
3% of all-time downloads
jrheiner/thesis-clip-geoloc-continent
thesis-clip-geoloc-continent is a zero-shot image classification model from jrheiner. Use it for the zero-shot image classification task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as cc-by-nc-4.0.
CLIP-ViT model fine-tuned for image geolocation. Optimized for queries at continent-level.
Downloads · 30 days
23
3% of all-time downloads
All-time downloads
917
Public
Parameters
428M
1.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.7 GB · 100%
From the Hugging Face model README
CLIP-ViT model fine-tuned for image geolocation. Optimized for queries at continent-level.
from PIL import Image
import requests
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("jrheiner/thesis-clip-geoloc-continent")
processor = CLIPProcessor.from_pretrained("jrheiner/thesis-clip-geoloc-continent")
url = "https://huggingface.co/spaces/jrheiner/thesis-demo/resolve/main/kerger-test-images/Oceania_Australia_-32.947127313081_151.47903359833_kerger.jpg"
image = Image.open(requests.get(url, stream=True).raw)
choices = ["North America", "Africa", "Asia", "Oceania", "South America", "Europe"]
inputs = processor(text=choices, images=image, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
The model was fine-tuned on 177 270 images (29 545 per continent) sourced from Mapillary.