Downloads · 30 days
0
eunkey/clip-vit-h-14-polaris-1to1
clip-vit-h-14-polaris-1to1 is a machine learning model from eunkey. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a fine-tuned version of the CLIP ViT-H-14 model on the Polaris dataset. The model was trained using one-to-one image-text pairs.
Downloads · 30 days
0
Access
Public
Updated May 23, 2025
Repo size
7.9 GB
Likes
0
Public
Click a slice to open those files.
.bin3.9 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of the CLIP ViT-H-14 model on the Polaris dataset. The model was trained using one-to-one image-text pairs.
import torch
import open_clip
from PIL import Image
# Load model
model, _, preprocess = open_clip.create_model_and_transforms('ViT-H-14')
model.load_state_dict(torch.load('pytorch_model.bin'))
model.eval()
# Prepare image and text
image = Image.open('your_image.jpg')
image = preprocess(image).unsqueeze(0)
text = "your text description"
# Get embeddings
with torch.no_grad():
image_features = model.encode_image(image)
text_features = model.encode_text(text)
# Normalize features
image_features = image_features / image_features.norm(dim=-1, keepdim=True)
text_features = text_features / text_features.norm(dim=-1, keepdim=True)
# Calculate similarity
similarity = (image_features @ text_features.t()).item()