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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: mit
|
3 |
+
datasets:
|
4 |
+
- laion/laion2B-en
|
5 |
+
- laion/laion-coco
|
6 |
+
- laion/laion2B-multi
|
7 |
+
- kakaobrain/coyo-700m
|
8 |
+
- conceptual_captions
|
9 |
+
- wanng/wukong100m
|
10 |
+
pipeline_tag: image-feature-extraction
|
11 |
+
---
|
12 |
+
|
13 |
+
# InternViT-6B-448px-V2_5
|
14 |
+
|
15 |
+
[\[📂 GitHub\]](https://github.com/OpenGVLab/InternVL) [\[🆕 Blog\]](https://internvl.github.io/blog/) [\[📜 InternVL 1.0 Paper\]](https://arxiv.org/abs/2312.14238) [\[📜 InternVL 1.5 Report\]](https://arxiv.org/abs/2404.16821) [\[📜 Mini-InternVL Report\]](https://arxiv.org/abs/2410.16261)
|
16 |
+
|
17 |
+
[\[🗨️ Chat Demo\]](https://internvl.opengvlab.com/) [\[🤗 HF Demo\]](https://huggingface.co/spaces/OpenGVLab/InternVL) [\[🚀 Quick Start\]](#quick-start) [\[📖 Documents\]](https://internvl.readthedocs.io/en/latest/)
|
18 |
+
|
19 |
+
InternViT-6B has been updated
|
20 |
+
We develop InternViT-6B-448px-V2_5 based on the pre-training of the strong foundation of InternViT-6B-448px-V1-5. Through ViT Incremental Learning with NTP loss, the vision encoder has gained a stronger ability to extract visual features, allowing it to capture more comprehensive information—especially for domains that are relatively underrepresented in web-scale datasets (e.g., LAION-5B), such as multilingual OCR data and mathematical charts, among others.
|
21 |
+
|
22 |
+
<div align="center">
|
23 |
+
|
24 |
+
| Model Name | HF Link |
|
25 |
+
| :---------------------: | :----------------------------------------: |
|
26 |
+
|InternViT-300M-448px-V2_5|[🤗 link](https://huggingface.co/OpenGVLab/InternViT-300M-448px-V2_5) |
|
27 |
+
|InternViT-6B-448px-V2_5|[🤗 link](https://huggingface.co/OpenGVLab/InternViT-6B-448px-V2_5)|
|
28 |
+
|
29 |
+
</div>
|
30 |
+
|
31 |
+
## Model Details
|
32 |
+
|
33 |
+
- **Model Type:** vision foundation model, feature backbone
|
34 |
+
- **Model Stats:**
|
35 |
+
- Params (M): 5540 (the last 3 blocks are discarded)
|
36 |
+
- Image size: 448 x 448, training with 1 - 12 tiles
|
37 |
+
- **Pretrain Dataset:** LAION-en, LAION-zh, COYO, GRIT, COCO, TextCaps, Objects365, OpenImages, All-Seeing, Wukong-OCR, LaionCOCO-OCR, and other OCR-related datasets.
|
38 |
+
To enhance the OCR capability of the model, we have incorporated additional OCR data alongside the general caption datasets. Specifically, we utilized PaddleOCR to perform Chinese OCR on images from Wukong and English OCR on images from LAION-COCO.
|
39 |
+
- **Note:** InternViT-6B originally had 48 blocks, and we found that using the output after the fourth-to-last block worked best for MLLM. For ease of use and to save GPU memory, we simply discarded the last 3 blocks. Now, the model has only 45 blocks and the number of parameters has been reduced from 5.9B to 5.5B. Therefore, if you want to build a MLLM based on this model, **please make use of the features from the last layer.**
|
40 |
+
|
41 |
+
## Performance
|
42 |
+
|
43 |
+
|
44 |
+
### Image Classification
|
45 |
+
|
46 |
+
<table style="width: 100%; text-align: center; border-collapse: collapse;">
|
47 |
+
<!-- <caption><strong>Image classification performance across different versions of InternViT.</strong><br>
|
48 |
+
We use IN-1K for training and evaluate on the IN-1K validation set as well as multiple ImageNet variants, including IN-ReaL, IN-V2, IN-A, IN-R, and IN-Sketch. Results are reported for both linear probing and attention pooling probing methods, with average accuracy for each method. $\Delta$ represents the performance gap between attention pooling probing and linear probing, where a larger $\Delta$ suggests a shift from learning simple linear features to capturing more complex, nonlinear semantic representations.
|
49 |
+
</caption> -->
|
50 |
+
<thead>
|
51 |
+
<tr>
|
52 |
+
<th rowspan="2">Model Name</th>
|
53 |
+
<th rowspan="2">res.</th>
|
54 |
+
<th colspan="7">Linear Probing</th>
|
55 |
+
<th colspan="7">Attention Pooling Probing</th>
|
56 |
+
<th rowspan="2">Δ</th>
|
57 |
+
</tr>
|
58 |
+
<tr>
|
59 |
+
<th>IN-1K</th>
|
60 |
+
<th>IN-ReaL</th>
|
61 |
+
<th>IN-V2</th>
|
62 |
+
<th>IN-A</th>
|
63 |
+
<th>IN-R</th>
|
64 |
+
<th>IN-Ske</th>
|
65 |
+
<th>avg.</th>
|
66 |
+
<th>IN-1K</th>
|
67 |
+
<th>IN-ReaL</th>
|
68 |
+
<th>IN-V2</th>
|
69 |
+
<th>IN-A</th>
|
70 |
+
<th>IN-R</th>
|
71 |
+
<th>IN-Ske</th>
|
72 |
+
<th>avg.</th>
|
73 |
+
</tr>
|
74 |
+
</thead>
|
75 |
+
<tbody>
|
76 |
+
<tr style="color: gray;">
|
77 |
+
<td>InternViT-6B-224px</td>
|
78 |
+
<td>224</td>
|
79 |
+
<td>88.2</td>
|
80 |
+
<td>90.4</td>
|
81 |
+
<td>79.9</td>
|
82 |
+
<td>77.5</td>
|
83 |
+
<td>89.8</td>
|
84 |
+
<td>69.1</td>
|
85 |
+
<td style="background-color: #d3d3d3;">82.5</td>
|
86 |
+
<td>89.2</td>
|
87 |
+
<td>91.1</td>
|
88 |
+
<td>82.3</td>
|
89 |
+
<td>84.7</td>
|
90 |
+
<td>93.1</td>
|
91 |
+
<td>72.7</td>
|
92 |
+
<td style="background-color: #d3d3d3;">85.5</td>
|
93 |
+
<td>3.0</td>
|
94 |
+
</tr>
|
95 |
+
<tr>
|
96 |
+
<td>InternViT-6B-224px</td>
|
97 |
+
<td>448</td>
|
98 |
+
<td>87.8</td>
|
99 |
+
<td>90.2</td>
|
100 |
+
<td>79.8</td>
|
101 |
+
<td>77.2</td>
|
102 |
+
<td>87.1</td>
|
103 |
+
<td>65.8</td>
|
104 |
+
<td style="background-color: #d3d3d3;">81.3</td>
|
105 |
+
<td>88.8</td>
|
106 |
+
<td>91.0</td>
|
107 |
+
<td>82.0</td>
|
108 |
+
<td>85.4</td>
|
109 |
+
<td>91.3</td>
|
110 |
+
<td>70.5</td>
|
111 |
+
<td style="background-color: #d3d3d3;">84.8</td>
|
112 |
+
<td>3.5</td>
|
113 |
+
</tr>
|
114 |
+
<tr>
|
115 |
+
<td>InternViT-6B-448px-V1.0</td>
|
116 |
+
<td>448</td>
|
117 |
+
<td>87.0</td>
|
118 |
+
<td>90.0</td>
|
119 |
+
<td>78.8</td>
|
120 |
+
<td>77.2</td>
|
121 |
+
<td>85.5</td>
|
122 |
+
<td>65.1</td>
|
123 |
+
<td style="background-color: #ffcccc;">80.6</td>
|
124 |
+
<td>88.7</td>
|
125 |
+
<td>91.0</td>
|
126 |
+
<td>82.0</td>
|
127 |
+
<td>88.7</td>
|
128 |
+
<td>92.8</td>
|
129 |
+
<td>72.0</td>
|
130 |
+
<td style="background-color: #90ee90;">85.9</td>
|
131 |
+
<td>5.3</td>
|
132 |
+
</tr>
|
133 |
+
<tr>
|
134 |
+
<td>InternViT-6B-448px-V1.2</td>
|
135 |
+
<td>448</td>
|
136 |
+
<td>87.0</td>
|
137 |
+
<td>89.9</td>
|
138 |
+
<td>78.5</td>
|
139 |
+
<td>77.1</td>
|
140 |
+
<td>83.9</td>
|
141 |
+
<td>59.7</td>
|
142 |
+
<td style="background-color: #ffcccc;">79.4</td>
|
143 |
+
<td>88.6</td>
|
144 |
+
<td>91.1</td>
|
145 |
+
<td>82.0</td>
|
146 |
+
<td>88.7</td>
|
147 |
+
<td>92.7</td>
|
148 |
+
<td>71.6</td>
|
149 |
+
<td style="background-color: #90ee90;">85.8</td>
|
150 |
+
<td>6.4</td>
|
151 |
+
</tr>
|
152 |
+
<tr>
|
153 |
+
<td>InternViT-6B-448px-V1.5</td>
|
154 |
+
<td>448</td>
|
155 |
+
<td>86.5</td>
|
156 |
+
<td>89.9</td>
|
157 |
+
<td>78.1</td>
|
158 |
+
<td>69.8</td>
|
159 |
+
<td>82.9</td>
|
160 |
+
<td>60.1</td>
|
161 |
+
<td style="background-color: #ffcccc;">77.9</td>
|
162 |
+
<td>88.4</td>
|
163 |
+
<td>91.2</td>
|
164 |
+
<td>81.6</td>
|
165 |
+
<td>86.0</td>
|
166 |
+
<td>92.2</td>
|
167 |
+
<td>70.9</td>
|
168 |
+
<td style="background-color: #90ee90;">85.1</td>
|
169 |
+
<td>7.2</td>
|
170 |
+
</tr>
|
171 |
+
<tr>
|
172 |
+
<td>InternViT-6B-448px-V2.5</td>
|
173 |
+
<td>448</td>
|
174 |
+
<td>86.6</td>
|
175 |
+
<td>90.1</td>
|
176 |
+
<td>77.8</td>
|
177 |
+
<td>73.7</td>
|
178 |
+
<td>82.7</td>
|
179 |
+
<td>60.0</td>
|
180 |
+
<td style="background-color: #ffcccc;">78.5</td>
|
181 |
+
<td>88.3</td>
|
182 |
+
<td>91.2</td>
|
183 |
+
<td>81.3</td>
|
184 |
+
<td>86.9</td>
|
185 |
+
<td>92.4</td>
|
186 |
+
<td>70.8</td>
|
187 |
+
<td style="background-color: #90ee90;">85.2</td>
|
188 |
+
<td>6.7</td>
|
189 |
+
</tr>
|
190 |
+
</tbody>
|
191 |
+
</table>
|
192 |
+
|
193 |
+
**Note:** ∆ represents the performance gap between attention pooling probing and linear probing, where a larger ∆ suggests a shift from learning simple linear features to capture more complex, nonlinear semantic representations
|
194 |
+
|
195 |
+
### Semantic Segmentation
|
196 |
+
|
197 |
+
<table style="width:100%; border-collapse: collapse; text-align: center;">
|
198 |
+
<thead>
|
199 |
+
<tr>
|
200 |
+
<th rowspan="2">Model Name</th>
|
201 |
+
<th colspan="3" >Linear Probing</th>
|
202 |
+
<th colspan="3" >Head Tuning (UperNet)</th>
|
203 |
+
<th colspan="3" >Full Tuning (UperNet)</th>
|
204 |
+
<th rowspan="2">Δ<sub>1</sub></th>
|
205 |
+
<th rowspan="2">Δ<sub>2</sub></th>
|
206 |
+
</tr>
|
207 |
+
<tr>
|
208 |
+
<th>ADE20K</th>
|
209 |
+
<th>COCO</th>
|
210 |
+
<th>avg.</th>
|
211 |
+
<th>ADE20K</th>
|
212 |
+
<th>COCO</th>
|
213 |
+
<th>avg.</th>
|
214 |
+
<th>ADE20K</th>
|
215 |
+
<th>COCO</th>
|
216 |
+
<th>avg.</th>
|
217 |
+
</tr>
|
218 |
+
</thead>
|
219 |
+
<tbody>
|
220 |
+
<tr>
|
221 |
+
<td>InternViT-6B-224px</td>
|
222 |
+
<td>47.2</td>
|
223 |
+
<td>42.8</td>
|
224 |
+
<td >45.0</td>
|
225 |
+
<td>54.9</td>
|
226 |
+
<td>48.9</td>
|
227 |
+
<td >51.9</td>
|
228 |
+
<td>58.9</td>
|
229 |
+
<td>51.6</td>
|
230 |
+
<td>55.3</td>
|
231 |
+
<td>6.9</td>
|
232 |
+
<td>10.2</td>
|
233 |
+
</tr>
|
234 |
+
<tr>
|
235 |
+
<td>InternViT-6B-448px-V1.0</td>
|
236 |
+
<td>43.6</td>
|
237 |
+
<td>38.5</td>
|
238 |
+
<td >41.0</td>
|
239 |
+
<td>55.4</td>
|
240 |
+
<td>49.4</td>
|
241 |
+
<td>52.4</td>
|
242 |
+
<td>58.1</td>
|
243 |
+
<td>51.7</td>
|
244 |
+
<td>54.9</td>
|
245 |
+
<td>11.3</td>
|
246 |
+
<td>13.9</td>
|
247 |
+
</tr>
|
248 |
+
<tr>
|
249 |
+
<td>InternViT-6B-448px-V1.2</td>
|
250 |
+
<td>40.7</td>
|
251 |
+
<td>36.1</td>
|
252 |
+
<td >38.4</td>
|
253 |
+
<td>55.2</td>
|
254 |
+
<td>48.8</td>
|
255 |
+
<td>52.0</td>
|
256 |
+
<td>58.8</td>
|
257 |
+
<td>51.7</td>
|
258 |
+
<td>55.2</td>
|
259 |
+
<td>13.6</td>
|
260 |
+
<td>16.8</td>
|
261 |
+
</tr>
|
262 |
+
<tr>
|
263 |
+
<td>InternViT-6B-448px-V1.5</td>
|
264 |
+
<td>40.9</td>
|
265 |
+
<td>36.3</td>
|
266 |
+
<td >38.6</td>
|
267 |
+
<td>55.0</td>
|
268 |
+
<td>49.1</td>
|
269 |
+
<td>52.0</td>
|
270 |
+
<td>58.8</td>
|
271 |
+
<td>51.5</td>
|
272 |
+
<td>55.2</td>
|
273 |
+
<td>13.4</td>
|
274 |
+
<td>16.6</td>
|
275 |
+
</tr>
|
276 |
+
<tr>
|
277 |
+
<td>InternViT-6B-448px-V2.5</td>
|
278 |
+
<td>39.4</td>
|
279 |
+
<td>35.6</td>
|
280 |
+
<td >37.5</td>
|
281 |
+
<td>55.4</td>
|
282 |
+
<td>49.7</td>
|
283 |
+
<td>52.6</td>
|
284 |
+
<td>58.6</td>
|
285 |
+
<td>51.8</td>
|
286 |
+
<td>55.2</td>
|
287 |
+
<td>15.1</td>
|
288 |
+
<td>17.7</td>
|
289 |
+
</tr>
|
290 |
+
</tbody>
|
291 |
+
</table>
|
292 |
+
|
293 |
+
**Note:** Δ<sub>1</sub> represents the gap between head tuning and linear probing, while Δ<sub>2</sub> shows the gap between full tuning and linear probing. A larger Δ value indicates a shift from simple linear features to more complex, nonlinear representations.
|
294 |
+
|
295 |
+
## Model Usage (Image Embeddings)
|
296 |
+
|
297 |
+
```python
|
298 |
+
import torch
|
299 |
+
from PIL import Image
|
300 |
+
from transformers import AutoModel, CLIPImageProcessor
|
301 |
+
|
302 |
+
model = AutoModel.from_pretrained(
|
303 |
+
'OpenGVLab/InternViT-6B-448px-V2_5',
|
304 |
+
torch_dtype=torch.bfloat16,
|
305 |
+
low_cpu_mem_usage=True,
|
306 |
+
trust_remote_code=True).cuda().eval()
|
307 |
+
|
308 |
+
image = Image.open('./examples/image1.jpg').convert('RGB')
|
309 |
+
|
310 |
+
image_processor = CLIPImageProcessor.from_pretrained('OpenGVLab/InternViT-6B-448px-V2_5')
|
311 |
+
|
312 |
+
pixel_values = image_processor(images=image, return_tensors='pt').pixel_values
|
313 |
+
pixel_values = pixel_values.to(torch.bfloat16).cuda()
|
314 |
+
|
315 |
+
outputs = model(pixel_values)
|
316 |
+
```
|
317 |
+
|
318 |
+
## Citation
|
319 |
+
|
320 |
+
If you find this project useful in your research, please consider citing:
|
321 |
+
|
322 |
+
```BibTeX
|
323 |
+
|
324 |
+
@article{chen2023internvl,
|
325 |
+
title={InternVL: Scaling up Vision Foundation Models and Aligning for Generic Visual-Linguistic Tasks},
|
326 |
+
author={Chen, Zhe and Wu, Jiannan and Wang, Wenhai and Su, Weijie and Chen, Guo and Xing, Sen and Zhong, Muyan and Zhang, Qinglong and Zhu, Xizhou and Lu, Lewei and Li, Bin and Luo, Ping and Lu, Tong and Qiao, Yu and Dai, Jifeng},
|
327 |
+
journal={arXiv preprint arXiv:2312.14238},
|
328 |
+
year={2023}
|
329 |
+
}
|
330 |
+
@article{chen2024far,
|
331 |
+
title={How Far Are We to GPT-4V? Closing the Gap to Commercial Multimodal Models with Open-Source Suites},
|
332 |
+
author={Chen, Zhe and Wang, Weiyun and Tian, Hao and Ye, Shenglong and Gao, Zhangwei and Cui, Erfei and Tong, Wenwen and Hu, Kongzhi and Luo, Jiapeng and Ma, Zheng and others},
|
333 |
+
journal={arXiv preprint arXiv:2404.16821},
|
334 |
+
year={2024}
|
335 |
+
}
|
336 |
+
|
337 |
+
```
|