Downloads · 30 days
12
6% of all-time downloads
rollenso/siglip-synthetic-hq-retrieval-v1
siglip-synthetic-hq-retrieval-v1 is a zero-shot image classification model from rollenso. Use it for the zero-shot image classification task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains a fine-tuned version of Google's SigLIP, optimized for high-precision semantic search and detailed image description alignment. The model is specifically engineered to understand complex visua…
Downloads · 30 days
12
6% of all-time downloads
All-time downloads
206
Public
Parameters
203M
407 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors406 MB · 100%
From the Hugging Face model README
This repository contains a fine-tuned version of Google's SigLIP, optimized for high-precision semantic search and detailed image description alignment. The model is specifically engineered to understand complex visual compositions, premium aesthetics, and intricate details that standard CLIP/SigLIP models often miss.
google/siglip-base-patch16-224pgvector or Milvus).Unlike standard models trained on brief web alt-texts, this model was fine-tuned using a High-Density Synthetic Dataset.
Due to its training on VLM-generated descriptions, this model excels when provided with descriptive, natural language queries. It is designed to match the "richness" of the visual data.
For optimal results, use detailed prompts that describe the scene:
❌ Basic Tag (Standard Performance):
texts = ["modern office"]
✅ Rich Description (Superior Performance):
texts = ["A minimalist modern office with natural sunlight, wooden furniture, and a clean glass desk against a neutral wall."]
Pro Tip: For production environments, we recommend using a small LLM proxy (like Qwen 1.5B or Llama 3) to expand simple user keywords into descriptive search sentences before generating embeddings.
import torch
import torch.nn.functional as F
from transformers import AutoProcessor, AutoModel
from PIL import Image
device = torch.device("mps" if torch.backends.mps.is_available() else ("cuda" if torch.cuda.is_available() else "cpu"))
model_path = "rollenso/siglip-synthetic-hq-retrieval-v1"
processor = AutoProcessor.from_pretrained(model_path)
model = AutoModel.from_pretrained(model_path, dtype=torch.bfloat16).to(device)
model.eval()
texts = [
"A product photography shot of a black mirrorless camera on a blue metallic tripod.",
"A glowing liquid glass user interface dashboard."
]
image = Image.open("path_to_your_image.jpg").convert("RGB")
inputs = processor(
text=texts,
images=image,
padding="max_length",
max_length=64,
truncation=True,
return_tensors="pt"
).to(device)
with torch.no_grad():
outputs = model(**inputs)
image_embeds = F.normalize(outputs.image_embeds, p=2, dim=-1)
text_embeds = F.normalize(outputs.text_embeds, p=2, dim=-1)
similarity = torch.matmul(image_embeds, text_embeds.t())
scores = similarity[0].cpu().tolist()
for text, score in zip(texts, scores):
print(f"[{score:.4f}] {text}")