foggy9/trendyol-dino-v2.1-ecommerce-256d
028
Trendyol DinoV2.1 Image Similarity Model
Fine-tuned DinoV2 (ViT-B/14) with [GeM pooling](https://arxiv.org/abs/1711.02512) for e-commerce product image retrieval. This is the successor to `Trendyol/trendyol-dino-v2-ecommerce-256d`.
Paper: TBD — "Visual Search at Trendyol" (in review)
Model Details
- Model Type: Image Similarity / Retrieval
- Architecture: DinoV2 ViT-B/14 + GeM pooling + linear projection (ArcFace-trained)
- Embedding Dimension: 256
- Input Size: 224×224
- Checkpoint:
ray-dinov2-full_catalog_1000_20-pfc-gem-mlp-run_12epoch 09 - Framework: PyTorch / SafeTensors
What's new vs v2
Quick Start
import torch
from PIL import Image
from transformers import AutoModel, AutoImageProcessor
device = "cuda" if torch.cuda.is_available() else "cpu"
repo = "Trendyol/trendyol-dino-v2.1-ecommerce-256d"
processor = AutoImageProcessor.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True).to(device).eval()
image = Image.open("your_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
inputs = {k: v.to(device) for k, v in inputs.items()}
with torch.no_grad():
embeddings = model(**inputs).last_hidden_state # [1, 256]
print(embeddings.shape)Preprocessing Pipeline
- ScaleImage: resize so max side = 224 (keep aspect ratio)
- PadToSquare: pad with color 255
- Resize: 224×224
- ToTensor + ImageNet Normalize (mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
Installation
pip install transformers torch torchvision safetensors pillow numpyIntended Use
- Product image similarity search
- Visual recommendations / duplicate detection
- Content-based retrieval in e-commerce
Limitations
- Optimized for product / e-commerce images
- Requires
trust_remote_code=True - Classification heads from training are not included in this Hub export (embeddings only)
License
See LICENSE. Same terms as the v2 release: source-available; commercial use requires attribution and prior notification to Trendyol (scr.datascience@trendyol.com).
Citation
@misc{trendyol-dinov2-ecommerce-v21,
title={Trendyol DinoV2.1 E-commerce Image Similarity Model},
author={Trendyol Data Science Team},
year={2026},
url={https://huggingface.co/Trendyol/trendyol-dino-v2.1-ecommerce-256d}
}
@article{radenovic2018gem,
title={Fine-tuning CNN Image Retrieval with No Human Annotation},
author={Radenovi{\'c}, Filip and Tolias, Giorgos and Chum, Ond{\v{r}}ej},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
volume={41},
number={7},
pages={1655--1668},
year={2018},
doi={10.1109/TPAMI.2018.2846566},
note={GeM pooling; also arXiv:1711.02512}
}
@misc{trendyol-visual-search-tbd,
title={Visual Search at Trendyol},
author={Trendyol Data Science Team},
year={2026},
note={Paper TBD (in review)}
}