Views
No views yet
google/siglip2-large-patch16-384
for material/surface visual-similarity retrieval. Trained with Supervised
Contrastive loss on catalog↔in-room segment pairs.| recall@1 | recall@5 | recall@10 |
|---|---|---|
| 0.2795 | 0.5486 | 0.6562 |
google/siglip2-large-patch16-384 (vision encoder)q_proj, k_proj, v_proj, out_proj (attention)| epoch | train_loss | recall@1 | recall@5 | recall@10 | intra | inter | sep |
|---|---|---|---|---|---|---|---|
| 1 | 0.4293 | 0.2674 | 0.5486 | 0.6562 | 0.7547 | 0.2508 | 3.0096 |
| 2 | 0.3911 | 0.2795 | 0.5365 | 0.6562 | 0.7380 | 0.2304 | 3.2032 |
| 3 | 0.3208 | 0.2604 | 0.5312 | 0.6562 | 0.7273 | 0.1999 | 3.6388 |
| 4 | 0.2828 | 0.2691 | 0.5434 | 0.6562 | 0.7238 | 0.1936 | 3.7391 |
intra — mean cosine similarity for same-class pairsinter — mean cosine similarity for cross-class pairssep — intra / inter (higher = better class separation)1from peft import PeftModel
2from transformers import AutoModel, AutoProcessor
3
4base = AutoModel.from_pretrained("google/siglip2-large-patch16-384")
5processor = AutoProcessor.from_pretrained("google/siglip2-large-patch16-384")
6model = PeftModel.from_pretrained(base, "subhrokomol/siglip2-large-lora-v1")
7model.eval()
8
9# image embedding (1024-dim)
10import torch
11from PIL import Image
12img = Image.open("your_image.jpg").convert("RGB")
13inputs = processor(images=img, return_tensors="pt")
14with torch.no_grad():
15 embed = model.get_image_features(**inputs)
16embed = embed / embed.norm(dim=-1, keepdim=True) # L2-normalize