Fine-tuning CNN Image Retrieval with No Human Annotation
Paper โข 1711.02512 โข Published
How to use Trendyol/trendyol-dino-v2.1-ecommerce-256d with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("feature-extraction", model="Trendyol/trendyol-dino-v2.1-ecommerce-256d", trust_remote_code=True) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Trendyol/trendyol-dino-v2.1-ecommerce-256d", trust_remote_code=True, device_map="auto")# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Trendyol/trendyol-dino-v2.1-ecommerce-256d", trust_remote_code=True, device_map="auto")Fine-tuned DinoV2 (ViT-B/14) with GeM pooling 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)
ray-dinov2-full_catalog_1000_20-pfc-gem-mlp-run_12 epoch 09| v2 | v2.1 | |
|---|---|---|
| Pooling / head | Flatten spatial tokens โ Linear(196608โ256) | GeM โ Linear(768โ256) |
| Training data | 300 distinct products per ~3400 categories | 1000 distinct products per ~3400 categories |
| Preprocess | Lanczos/JPEG/332 pad pipeline | Scale+pad to 224 (training inference preprocess) |
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)
pip install transformers torch torchvision safetensors pillow numpy
trust_remote_code=TrueSee LICENSE. Same terms as the v2 release: source-available; commercial use requires attribution and prior notification to Trendyol (scr.datascience@trendyol.com).
@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)}
}
Base model
Trendyol/trendyol-dino-v2-ecommerce-256d
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Trendyol/trendyol-dino-v2.1-ecommerce-256d", trust_remote_code=True)