EUPE
English

Add transformers-format weights (safetensors) + config

#1
by Molbap HF Staff - opened
Files changed (4) hide show
  1. README.md +58 -166
  2. config.json +55 -0
  3. model.safetensors +3 -0
  4. preprocessor_config.json +22 -0
README.md CHANGED
@@ -1,22 +1,18 @@
1
  ---
 
 
 
 
2
  tags:
3
  - eupe
4
- license: fair-noncommercial-research-license
5
- language:
6
- - en
7
  ---
 
8
  # Model Card for EUPE
9
 
10
- Running AI models on smart edge devices can unlock various user experiences, but presents challenges
11
- due to limited compute and the need to handle multiple tasks simultaneously. This requires a vision
12
- encoder with small size but powerful and versatile representations. We present our method, Efficient
13
- Universal Perception Encoder (EUPE), which offers both inference efficiency and universally good
14
- representations for diverse downstream tasks. We achieve this by distilling from multiple domain-expert
15
- foundation vision encoders. Unlike previous agglomerative methods that directly scale down from
16
- multiple teachers to an efficient encoder, we demonstrate the importance of first scaling up to a large
17
- proxy teacher and then distilling from this single teacher. Experiments show that EUPE achieves
18
- on-par or better performance than individual domain experts of the same size on diverse task domains
19
- and also outperforms previous agglomerative encoders.
20
 
21
  ## Model Details
22
 
@@ -31,19 +27,18 @@ The models can accept larger images provided the image shapes are multiples of t
31
 
32
  ### Model Description
33
 
34
- - **Developed by:** Meta AI
35
- - **Model type:** Vision Transformer, ConvNeXt
36
- - **License:** [FAIR Research License](https://huggingface.co/facebook/fair-noncommercial-research-license/)
37
 
38
  ### Model Sources
39
 
40
- - **Repository:** [https://github.com/facebookresearch/eupe](https://github.com/facebookresearch/eupe)
41
- - **Paper:** [https://arxiv.org/abs/2603.22387](https://arxiv.org/abs/2603.22387)
42
 
43
  ## Uses
44
 
45
- The models are vision backbones providing multi-purpose features for downstream tasks, especially suitable for multi-task setting under limited compute budget.
46
- The models can be used without fine-tuning, with downstream modules ranging from non-parametric operators, simple linear layers to heavier language decoders, to obtain competitive results:
47
 
48
  - on image classification, using k-NN classifiers on the class token
49
  - on semantic 3D keypoint correspondances
@@ -52,9 +47,32 @@ The models can be used without fine-tuning, with downstream modules ranging from
52
 
53
  ## Get Started
54
 
55
- Follow the [Installation](https://github.com/facebookresearch/EUPE/tree/main?tab=readme-ov-file#installation) to set up the environment.
56
- Clone the [EUPE repo](https://github.com/facebookresearch/eupe) and download the PyTorch model checkpoints to local.
57
- The example below demonstrates how to obtain the class token and patch tokens given an input image.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  ```python
60
  import torch
@@ -89,157 +107,31 @@ with torch.inference_mode():
89
  batch_img = transform(img)[None]
90
  outputs = model.forward_features(batch_img)
91
  clstoken, patchtokens = outputs["x_norm_clstoken"], outputs["x_norm_patchtokens"]
92
-
93
  ```
94
 
95
  ## Results
96
 
97
  The reader is referred to the associated paper for details on the evaluation protocols.
98
 
99
- *Results for ViT backbones*
100
-
101
- <table>
102
- <thead>
103
- <tr>
104
- <th rowspan="2">Model</th>
105
- <th rowspan="2">#Params</th>
106
- <th colspan="2">Image Understanding</th>
107
- <th colspan="6">Vision Language Modeling</th>
108
- <th colspan="3">Dense Prediction</th>
109
- </tr>
110
- <tr>
111
- <th>IN1k-ZS</th>
112
- <th>IN1k-KNN</th>
113
- <th>TextVQA</th>
114
- <th>SQA</th>
115
- <th>Realworld</th>
116
- <th>POPE</th>
117
- <th>GQA</th>
118
- <th>MMEp</th>
119
- <th>SPair</th>
120
- <th>NYUv2↓</th>
121
- <th>ADE20k</th>
122
- </tr>
123
- </thead>
124
- <tbody>
125
- <tr>
126
- <td>EUPE-ViT-T</td>
127
- <td>6M</td>
128
- <td>50.5</td>
129
- <td>66.3</td>
130
- <td>42.0</td>
131
- <td>69.5</td>
132
- <td>50.0</td>
133
- <td>82.4</td>
134
- <td>61.4</td>
135
- <td>1258.0</td>
136
- <td>37.2</td>
137
- <td>0.571</td>
138
- <td>36.7</td>
139
- </tr>
140
- <tr>
141
- <td>EUPE-ViT-S</td>
142
- <td>20M</td>
143
- <td>69.8</td>
144
- <td>78.2</td>
145
- <td>44.1</td>
146
- <td>69.3</td>
147
- <td>51.7</td>
148
- <td>84.5</td>
149
- <td>65.0</td>
150
- <td>1304.9</td>
151
- <td>46.5</td>
152
- <td>0.455</td>
153
- <td>46.6</td>
154
- </tr>
155
- <tr>
156
- <td>EUPE-ViT-B</td>
157
- <td>86M</td>
158
- <td>79.7</td>
159
- <td>84.1</td>
160
- <td>50.4</td>
161
- <td>69.7</td>
162
- <td>55.5</td>
163
- <td>85.9</td>
164
- <td>67.3</td>
165
- <td>1374.5</td>
166
- <td>51.3</td>
167
- <td>0.391</td>
168
- <td>52.4</td>
169
- </tr>
170
- </tbody>
171
- </table>
172
-
173
- *Results for ConvNeXt backbones
174
-
175
- <table>
176
- <thead>
177
- <tr>
178
- <th rowspan="2">Model</th>
179
- <th rowspan="2">#Params</th>
180
- <th colspan="6">Vision Language Modeling</th>
181
- <th colspan="3">Dense Prediction</th>
182
- </tr>
183
- <tr>
184
- <th>TextVQA</th>
185
- <th>SQA</th>
186
- <th>Realworld</th>
187
- <th>POPE</th>
188
- <th>GQA</th>
189
- <th>MMEp</th>
190
- <th>SPair</th>
191
- <th>NYUv2↓</th>
192
- <th>ADE20k</th>
193
- </tr>
194
- </thead>
195
- <tbody>
196
- <tr>
197
- <td>EUPE-ConvNeXt-T</td>
198
- <td>29M</td>
199
- <td>43.7</td>
200
- <td>68.8</td>
201
- <td>47.9</td>
202
- <td>83.4</td>
203
- <td>63.0</td>
204
- <td>1278.1</td>
205
- <td>41.3</td>
206
- <td>0.430</td>
207
- <td>43.5</td>
208
- </tr>
209
- <tr>
210
- <td>EUPE-ConvNeXt-S</td>
211
- <td>50M</td>
212
- <td>45.0</td>
213
- <td>68.9</td>
214
- <td>50.5</td>
215
- <td>84.0</td>
216
- <td>64.7</td>
217
- <td>1284.2</td>
218
- <td>40.1</td>
219
- <td>0.388</td>
220
- <td>46.8</td>
221
- </tr>
222
- <tr>
223
- <td>EUPE-ConvNeXt-B</td>
224
- <td>89M</td>
225
- <td>46.4</td>
226
- <td>70.1</td>
227
- <td>53.3</td>
228
- <td>84.7</td>
229
- <td>65.8</td>
230
- <td>1348.9</td>
231
- <td>37.7</td>
232
- <td>0.365</td>
233
- <td>48.9</td>
234
- </tr>
235
- </tbody>
236
- </table>
237
 
238
- ## Citation
 
 
 
 
239
 
240
- **BibTeX**
241
 
242
- ```
 
 
 
 
 
 
 
 
243
  @misc{zhu2026eupe,
244
  title={Efficient Universal Perception Encoder},
245
  author={Zhu, Chenchen and Suri, Saksham and Jose, Cijo and Oquab, Maxime and Szafraniec, Marc and Wen, Wei and Xiong, Yunyang and Labatut, Patrick and Bojanowski, Piotr and Krishnamoorthi, Raghuraman and Chandra, Vikas},
@@ -249,4 +141,4 @@ The reader is referred to the associated paper for details on the evaluation pro
249
  primaryClass={cs.CV},
250
  url={https://arxiv.org/abs/2603.22387},
251
  }
252
- ```
 
1
  ---
2
+ library_name: transformers
3
+ license: other
4
+ license_name: fair-noncommercial-research-license
5
+ pipeline_tag: image-feature-extraction
6
  tags:
7
  - eupe
8
+ - dinov3
9
+ - vision
10
+ - image-feature-extraction
11
  ---
12
+
13
  # Model Card for EUPE
14
 
15
+ Running AI models on smart edge devices can unlock various user experiences, but presents challenges due to limited compute and the need to handle multiple tasks simultaneously. This requires a vision encoder with small size but powerful and versatile representations. We present our method, Efficient Universal Perception Encoder (EUPE), which offers both inference efficiency and universally good representations for diverse downstream tasks. We achieve this by distilling from multiple domain-expert foundation vision encoders. Unlike previous agglomerative methods that directly scale down from multiple teachers to an efficient encoder, we demonstrate the importance of first scaling up to a large proxy teacher and then distilling from this single teacher. Experiments show that EUPE achieves on-par or better performance than individual domain experts of the same size on diverse task domains and also outperforms previous agglomerative encoders.
 
 
 
 
 
 
 
 
 
16
 
17
  ## Model Details
18
 
 
27
 
28
  ### Model Description
29
 
30
+ - Developed by: Meta AI
31
+ - Model type: Vision Transformer, ConvNeXt
32
+ - License: FAIR Research License
33
 
34
  ### Model Sources
35
 
36
+ - Repository: https://github.com/facebookresearch/eupe
37
+ - Paper: https://arxiv.org/abs/2603.22387
38
 
39
  ## Uses
40
 
41
+ The models are vision backbones providing multi-purpose features for downstream tasks, especially suitable for multi-task setting under limited compute budget. The models can be used without fine-tuning, with downstream modules ranging from non-parametric operators, simple linear layers to heavier language decoders, to obtain competitive results:
 
42
 
43
  - on image classification, using k-NN classifiers on the class token
44
  - on semantic 3D keypoint correspondances
 
47
 
48
  ## Get Started
49
 
50
+ ### With 🤗 Transformers
51
+
52
+ This checkpoint is in the Transformers format: EUPE reuses the DINOv3 architecture, so it loads with `AutoModel`.
53
+
54
+ ```python
55
+ import torch
56
+ from transformers import AutoImageProcessor, AutoModel
57
+ from transformers.image_utils import load_image
58
+
59
+ image = load_image("http://images.cocodataset.org/val2017/000000039769.jpg")
60
+ repo = "facebook/EUPE-ViT-B"
61
+
62
+ processor = AutoImageProcessor.from_pretrained(repo)
63
+ model = AutoModel.from_pretrained(repo)
64
+
65
+ inputs = processor(images=image, return_tensors="pt")
66
+ with torch.inference_mode():
67
+ outputs = model(**inputs)
68
+
69
+ clstoken = outputs.pooler_output # class token
70
+ hidden_states = outputs.last_hidden_state # class token, then (register and) patch tokens
71
+ ```
72
+
73
+ ### With the original code
74
+
75
+ Follow the [Installation](https://github.com/facebookresearch/eupe) to set up the environment. Clone the [EUPE repo](https://github.com/facebookresearch/eupe) and download the PyTorch model checkpoints to local. The example below demonstrates how to obtain the class token and patch tokens given an input image.
76
 
77
  ```python
78
  import torch
 
107
  batch_img = transform(img)[None]
108
  outputs = model.forward_features(batch_img)
109
  clstoken, patchtokens = outputs["x_norm_clstoken"], outputs["x_norm_patchtokens"]
 
110
  ```
111
 
112
  ## Results
113
 
114
  The reader is referred to the associated paper for details on the evaluation protocols.
115
 
116
+ Results for ViT backbones
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
 
118
+ | Model | #Params | IN1k-ZS | IN1k-KNN | TextVQA | SQA | Realworld | POPE | GQA | MMEp | SPair | NYUv2↓ | ADE20k |
119
+ |---|---|---|---|---|---|---|---|---|---|---|---|---|
120
+ | EUPE-ViT-T | 6M | 50.5 | 66.3 | 42.0 | 69.5 | 50.0 | 82.4 | 61.4 | 1258.0 | 37.2 | 0.571 | 36.7 |
121
+ | EUPE-ViT-S | 20M | 69.8 | 78.2 | 44.1 | 69.3 | 51.7 | 84.5 | 65.0 | 1304.9 | 46.5 | 0.455 | 46.6 |
122
+ | EUPE-ViT-B | 86M | 79.7 | 84.1 | 50.4 | 69.7 | 55.5 | 85.9 | 67.3 | 1374.5 | 51.3 | 0.391 | 52.4 |
123
 
124
+ Results for ConvNeXt backbones
125
 
126
+ | Model | #Params | TextVQA | SQA | Realworld | POPE | GQA | MMEp | SPair | NYUv2↓ | ADE20k |
127
+ |---|---|---|---|---|---|---|---|---|---|---|
128
+ | EUPE-ConvNeXt-T | 29M | 43.7 | 68.8 | 47.9 | 83.4 | 63.0 | 1278.1 | 41.3 | 0.430 | 43.5 |
129
+ | EUPE-ConvNeXt-S | 50M | 45.0 | 68.9 | 50.5 | 84.0 | 64.7 | 1284.2 | 40.1 | 0.388 | 46.8 |
130
+ | EUPE-ConvNeXt-B | 89M | 46.4 | 70.1 | 53.3 | 84.7 | 65.8 | 1348.9 | 37.7 | 0.365 | 48.9 |
131
+
132
+ ## Citation
133
+
134
+ ```bibtex
135
  @misc{zhu2026eupe,
136
  title={Efficient Universal Perception Encoder},
137
  author={Zhu, Chenchen and Suri, Saksham and Jose, Cijo and Oquab, Maxime and Szafraniec, Marc and Wen, Wei and Xiong, Yunyang and Labatut, Patrick and Bojanowski, Piotr and Krishnamoorthi, Raghuraman and Chandra, Vikas},
 
141
  primaryClass={cs.CV},
142
  url={https://arxiv.org/abs/2603.22387},
143
  }
144
+ ```
config.json ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "apply_layernorm": true,
3
+ "architectures": [
4
+ "DINOv3ViTModel"
5
+ ],
6
+ "attention_dropout": 0.0,
7
+ "drop_path_rate": 0.0,
8
+ "dtype": "float32",
9
+ "hidden_act": "gelu",
10
+ "hidden_size": 768,
11
+ "image_size": 224,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "key_bias": false,
15
+ "layer_norm_eps": 1e-05,
16
+ "layerscale_value": 1e-05,
17
+ "mlp_bias": true,
18
+ "model_type": "dinov3_vit",
19
+ "num_attention_heads": 12,
20
+ "num_channels": 3,
21
+ "num_hidden_layers": 12,
22
+ "num_register_tokens": 4,
23
+ "out_features": [
24
+ "stage12"
25
+ ],
26
+ "out_indices": [
27
+ 12
28
+ ],
29
+ "patch_size": 16,
30
+ "pos_embed_jitter": null,
31
+ "pos_embed_rescale": 2.0,
32
+ "pos_embed_shift": null,
33
+ "proj_bias": true,
34
+ "query_bias": true,
35
+ "reshape_hidden_states": true,
36
+ "rope_theta": 100.0,
37
+ "stage_names": [
38
+ "stem",
39
+ "stage1",
40
+ "stage2",
41
+ "stage3",
42
+ "stage4",
43
+ "stage5",
44
+ "stage6",
45
+ "stage7",
46
+ "stage8",
47
+ "stage9",
48
+ "stage10",
49
+ "stage11",
50
+ "stage12"
51
+ ],
52
+ "transformers_version": "5.10.0.dev0",
53
+ "use_gated_mlp": false,
54
+ "value_bias": true
55
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd2bf1ea838c5bb2d5acb2c87b168403acc5e5ebc214de65531edf048175b18b
3
+ size 342662192
preprocessor_config.json ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_normalize": true,
3
+ "do_rescale": true,
4
+ "do_resize": true,
5
+ "image_mean": [
6
+ 0.485,
7
+ 0.456,
8
+ 0.406
9
+ ],
10
+ "image_processor_type": "DINOv3ViTImageProcessor",
11
+ "image_std": [
12
+ 0.229,
13
+ 0.224,
14
+ 0.225
15
+ ],
16
+ "resample": 2,
17
+ "rescale_factor": 0.00392156862745098,
18
+ "size": {
19
+ "height": 256,
20
+ "width": 256
21
+ }
22
+ }