File size: 4,098 Bytes
9b4607d
 
 
 
 
 
 
1e4ce19
 
 
 
 
 
91de6a0
 
 
 
1e4ce19
91de6a0
1e4ce19
91de6a0
1e4ce19
 
 
 
 
 
 
91de6a0
076f658
a8057f8
076f658
 
 
1e4ce19
91de6a0
97ed800
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91de6a0
1e4ce19
91de6a0
97ed800
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91de6a0
97ed800
 
91de6a0
1e4ce19
91de6a0
97ed800
 
91de6a0
97ed800
 
 
 
91de6a0
1e4ce19
91de6a0
97ed800
91de6a0
1e4ce19
 
97ed800
 
91de6a0
1e4ce19
91de6a0
1e4ce19
 
 
 
91de6a0
 
 
97ed800
 
 
a8057f8
97ed800
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
license: apache-2.0
language:
- en
base_model:
- facebook/dinov3-vitl16-pretrain-lvd1689m
pipeline_tag: image-feature-extraction
tags:
- fashion
- image-retrieval
- vision-transformer
- dino
library_name: transformers
---

# GR-Lite: Fashion Image Retrieval Model

GR-Lite is a fashion image retrieval model fine-tuned from [DINOv3-ViT-L/16](https://huggingface.co/facebook/dinov3-vitl16-pretrain-lvd1689m). It extracts 1024-dimensional L2-normalized embeddings optimized for fashion product search and retrieval.

GR-Lite achieves state-of-the-art performance on [LookBench](https://huggingface.co/datasets/srpone/look-bench) and other fashion retrieval benchmarks. See the [paper](https://arxiv.org/abs/2601.14706) for detailed metrics.

| Property | Value |
|----------|-------|
| Architecture | ViT-L/16 (DINOv2-style) |
| Parameters | 303M |
| Input | 336 x 336 RGB |
| Output | 1024-dim L2-normalized embedding |
| Framework | PyTorch / Transformers |


** Update: The pro version can be accessed via **https://apiclaw.io/en/api-docs** with /openapi/v2/model/fashion-image-embedding endpoint. **  



## Quick Start

```python
from transformers import AutoModel
import torch
from PIL import Image
from torchvision import transforms

# Load model
model = AutoModel.from_pretrained("srpone/gr-lite", trust_remote_code=True)
model.eval()

# Preprocess
transform = transforms.Compose([
    transforms.Resize((336, 336)),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])

image = Image.open("your_image.jpg").convert("RGB")
pixel_values = transform(image).unsqueeze(0)  # [1, 3, 336, 336]

# Extract embedding
with torch.no_grad():
    output = model(pixel_values)
    embedding = output.pooler_output  # [1, 1024], L2-normalized

print(f"Embedding shape: {embedding.shape}")
```

## Feature Extraction (Batch)

```python
from torch.utils.data import DataLoader, Dataset

class ImageDataset(Dataset):
    def __init__(self, image_paths, transform):
        self.image_paths = image_paths
        self.transform = transform

    def __len__(self):
        return len(self.image_paths)

    def __getitem__(self, idx):
        image = Image.open(self.image_paths[idx]).convert("RGB")
        return self.transform(image)

# Create dataloader
dataset = ImageDataset(your_image_paths, transform)
loader = DataLoader(dataset, batch_size=64, num_workers=4)

# Extract all embeddings
all_embeddings = []
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)

with torch.no_grad():
    for batch in loader:
        output = model(batch.to(device))
        all_embeddings.append(output.pooler_output.cpu())

embeddings = torch.cat(all_embeddings, dim=0)  # [N, 1024]
```

## Image Retrieval

```python
import torch.nn.functional as F

# query_emb: [1, 1024], gallery_embs: [N, 1024]
similarity = query_emb @ gallery_embs.T  # cosine similarity (already L2-normalized)
top_k_indices = similarity.argsort(descending=True)[0, :10]
```

## Model Outputs

The model returns a `BaseModelOutputWithPooling`:

| Field | Shape | Description |
|-------|-------|-------------|
| `pooler_output` | `[B, 1024]` | L2-normalized CLS token embedding (use this for retrieval) |
| `last_hidden_state` | `[B, 446, 1024]` | Full sequence output (CLS + 4 registers + 441 patches) |

## Resources

- **Project Site**: [LookBench](https://serendipityoneinc.github.io/look-bench-page/)
- **Paper**: [LookBench: A Comprehensive Benchmark for Fashion Image Retrieval](https://arxiv.org/abs/2601.14706)
- **Benchmark Dataset**: [srpone/look-bench](https://huggingface.co/datasets/srpone/look-bench)
- **Code & Notebooks**: [look-bench GitHub](https://github.com/SerendipityOneInc/look-bench)

## Citation

```bibtex
@article{gao2026lookbench,
      title={LookBench: A Live and Holistic Open Benchmark for Fashion Image Retrieval},
      author={Chao Gao and Siqiao Xue and Jiwen Fu and Tingyi Gu and Shanshan Li and Fan Zhou},
      year={2026},
      url={https://arxiv.org/abs/2601.14706},
      journal={arXiv preprint arXiv:2601.14706},
}
```