Downloads · 30 days
27
7% of all-time downloads
xuemduan/reevaluate-clip
reevaluate-clip is a machine learning model from xuemduan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
The fine-tuned CLIP (Vit-L/14) used in Knowledge-Enhanced Multimodal Retrieval
Downloads · 30 days
27
7% of all-time downloads
All-time downloads
365
Public
Parameters
428M
3.4 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors1.7 GB · 100%
From the Hugging Face model README
The fine-tuned CLIP (Vit-L/14) used in Knowledge-Enhanced Multimodal Retrieval
| Model | Description | Data Type |
|---|---|---|
reevaluate-clip | Fine-tuned on images, query texts, and description texts | Image+Text |
The models were trained and evaluated on the REEVLAUATE Image-Text Pair Dataset, which contains 43,500 image–text pairs derived from Wikidata and Pilot Museums.
Each artefact is described by:
Image: artefact imageDescription text: BLIP-generated natural language portion + meatadata portionQuery text: User query-like textDataset: xuemduan/reevaluate-image-text-pairs
from transformers import CLIPProcessor, CLIPModel
from PIL import Image
model = CLIPModel.from_pretrained("xuemduan/reevaluate-clip")
processor = CLIPProcessor.from_pretrained("xuemduan/reevaluate-clip")
image = Image.open("artefact.jpg")
text = "yellow flower paintings"
image_embeds = model.get_image_features(**processor(images=image, return_tensors="pt"))
text_embeds = model.get_text_features(**processor(text=[text], return_tensors="pt"))
# normalize
image_embeds = image_embeds / image_embeds.norm(dim=-1, keepdim=True)
text_embeds = text_embeds / text_embeds.norm(dim=-1, keepdim=True)
similarity = (image_embeds @ text_embeds.T)
print(similarity)