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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- zh
|
4 |
+
- en
|
5 |
+
tags:
|
6 |
+
- qwen
|
7 |
+
pipeline_tag: text-generation
|
8 |
+
inference: false
|
9 |
---
|
10 |
+
|
11 |
+
# Qwen-VL-Chat-Int4
|
12 |
+
|
13 |
+
<br>
|
14 |
+
|
15 |
+
<p align="center">
|
16 |
+
<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/logo.jpg" width="400"/>
|
17 |
+
<p>
|
18 |
+
<br>
|
19 |
+
|
20 |
+
<p align="center">
|
21 |
+
Qwen-VL <a href="https://modelscope.cn/models/qwen/Qwen-VL/summary">🤖 <a> | <a href="https://huggingface.co/Qwen/Qwen-VL">🤗</a>  | Qwen-VL-Chat <a href="https://modelscope.cn/models/qwen/Qwen-VL-Chat/summary">🤖 <a>| <a href="https://huggingface.co/Qwen/Qwen-VL-Chat">🤗</a>  | Qwen-VL-Chat-Int4 <a href="https://huggingface.co/Qwen/Qwen-VL-Chat-Int4">🤗</a>
|
22 |
+
<br>
|
23 |
+
<a href="assets/wechat.png">WeChat</a>   |   <a href="https://discord.gg/z3GAxXZ9Ce">Discord</a>   |   <a href="https://modelscope.cn/studios/qwen/Qwen-VL-Chat-Demo/summary">Demo</a>  |  <a href="https://arxiv.org/abs/2308.12966">Report</a>
|
24 |
+
</p>
|
25 |
+
<br>
|
26 |
+
|
27 |
+
**Qwen-VL** 是阿里云研发的大规模视觉语言模型(Large Vision Language Model, LVLM)。Qwen-VL 可以以图像、文本、检测框作为输入,并以文本和检测框作为输出。Qwen-VL 系列模型性能强大,具备多语言对话、多图交错对话等能力,并支持中文开放域定位和细粒度图像识别与理解。
|
28 |
+
|
29 |
+
**Qwen-VL** (Qwen Large Vision Language Model) is the visual multimodal version of the large model series, Qwen (abbr. Tongyi Qianwen), proposed by Alibaba Cloud. Qwen-VL accepts image, text, and bounding box as inputs, outputs text and bounding box. The features of Qwen-VL include:
|
30 |
+
|
31 |
+
目前,我们提供了Qwen-VL和Qwen-VL-Chat两个模型,分别为预训练模型和Chat模型。如果想了解更多关于模型的信息,请点击[链接](https://github.com/QwenLM/Qwen-VL/blob/master/visual_memo.md)查看我们的技术备忘录。本仓库为Qwen-VL-Chat的量化模型Qwen-VL-Chat-Int4仓库。
|
32 |
+
|
33 |
+
We release Qwen-VL and Qwen-VL-Chat, which are pretrained model and Chat model respectively. For more details about Qwen-VL, please refer to our [technical memo](https://github.com/QwenLM/Qwen-VL/blob/master/visual_memo.md). This repo is the one for Qwen-VL-Chat-Int4.
|
34 |
+
<br>
|
35 |
+
|
36 |
+
## 安装要求 (Requirements)
|
37 |
+
|
38 |
+
* python 3.8及以上版本
|
39 |
+
* pytorch2.0及以上版本
|
40 |
+
* 建议使用CUDA 11.4及以上
|
41 |
+
* python 3.8 and above
|
42 |
+
* pytorch 2.0 and above are recommended
|
43 |
+
* CUDA 11.4 and above are recommended
|
44 |
+
<br>
|
45 |
+
|
46 |
+
## 快速开始 (Quickstart)
|
47 |
+
|
48 |
+
我们提供简单的示例来说明如何利用 🤗 Transformers 快速使用Qwen-VL-Chat-Int4。
|
49 |
+
|
50 |
+
在开始前,请确保你已经配置好环境并安装好相关的代码包。最重要的是,确保你满足上述要求,然后安装相关的依赖库。
|
51 |
+
|
52 |
+
Below, we provide simple examples to show how to use Qwen-VL-Chat-Int4 with 🤗 Transformers.
|
53 |
+
|
54 |
+
Before running the code, make sure you have setup the environment and installed the required packages. Make sure you meet the above requirements, and then install the dependent libraries.
|
55 |
+
|
56 |
+
```bash
|
57 |
+
pip install -r requirements.txt
|
58 |
+
pip install auto-gptq optimum
|
59 |
+
```
|
60 |
+
|
61 |
+
接下来你可以开始使用Transformers来使用我们的模型。关于视觉模块的更多用法,请参考[教程](TUTORIAL.md)。
|
62 |
+
|
63 |
+
Now you can start with Transformers. More usage aboue vision encoder, please refer to [tutorial](TUTORIAL_zh.md).
|
64 |
+
|
65 |
+
#### 🤗 Transformers
|
66 |
+
|
67 |
+
To use Qwen-VL-Chat-Int4 for the inference, all you need to do is to input a few lines of codes as demonstrated below. However, **please make sure that you are using the latest code.**
|
68 |
+
|
69 |
+
```python
|
70 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
71 |
+
import torch
|
72 |
+
torch.manual_seed(1234)
|
73 |
+
|
74 |
+
# Note: The default behavior now has injection attack prevention off.
|
75 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen-VL-Chat-Int4", trust_remote_code=True)
|
76 |
+
|
77 |
+
# use cuda device
|
78 |
+
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen-VL-Chat-Int4", device_map="cuda", trust_remote_code=True).eval()
|
79 |
+
|
80 |
+
# 1st dialogue turn
|
81 |
+
query = tokenizer.from_list_format([
|
82 |
+
{'image': 'https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg'},
|
83 |
+
{'text': '这是什么'},
|
84 |
+
])
|
85 |
+
response, history = model.chat(tokenizer, query=query, history=None)
|
86 |
+
print(response)
|
87 |
+
# 图中是一名年轻女子在沙滩上和她的狗玩耍,狗的品种可能是拉布拉多。她们坐在沙滩上,狗的前腿抬起来,似乎在和人类击掌。两人之间充满了信任和爱。
|
88 |
+
|
89 |
+
# 2nd dialogue turn
|
90 |
+
response, history = model.chat(tokenizer, '输出"击掌"的检测框', history=history)
|
91 |
+
print(response)
|
92 |
+
# <ref>击掌</ref><box>(517,508),(589,611)</box>
|
93 |
+
image = tokenizer.draw_bbox_on_latest_picture(response, history)
|
94 |
+
if image:
|
95 |
+
image.save('1.jpg')
|
96 |
+
else:
|
97 |
+
print("no box")
|
98 |
+
```
|
99 |
+
|
100 |
+
<p align="center">
|
101 |
+
<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo_highfive.jpg" width="500"/>
|
102 |
+
<p>
|
103 |
+
<br>
|
104 |
+
|
105 |
+
## 量化 (Quantization)
|
106 |
+
|
107 |
+
### 效果评测 (Performance)
|
108 |
+
|
109 |
+
我们列出不同精度下模型在评测基准 **[TouchStone](https://github.com/OFA-Sys/TouchStone)** 上的表现,并发现量化模型并没有显著性能损失。结果如下所示:
|
110 |
+
|
111 |
+
We illustrate the model performance of both BF16 and Int4 models on the benchmark **[TouchStone](https://github.com/OFA-Sys/TouchStone)**, and we find that the quantized model does not suffer from significant performance degradation. Results are shown below:
|
112 |
+
|
113 |
+
| Quantization | ZH. | EN |
|
114 |
+
| ------------ | :--------: | :-----------: |
|
115 |
+
| BF16 | 401.2 | 645.2 |
|
116 |
+
| Int4 | 386.6 | 651.4 |
|
117 |
+
|
118 |
+
### 推理速度 (Inference Speed)
|
119 |
+
|
120 |
+
我们测算了在输入一张图片(即258个token)的条件下BF16和Int4的模型生成1792 (2048-258) 和 7934 (8192-258) 个token的平均速度。
|
121 |
+
|
122 |
+
We measured the average inference speed (tokens/s) of generating 1792 (2048-258) and 7934 (8192-258) tokens with the context of an image (which takes 258 tokens) under BF16 precision and Int4 quantization, respectively.
|
123 |
+
|
124 |
+
| Quantization | Speed (2048 tokens) | Speed (8192 tokens) |
|
125 |
+
| ------------ | :-----------------: | :-----------------: |
|
126 |
+
| BF16 | 28.87 | 24.32 |
|
127 |
+
| Int4 | 37.79 | 34.34 |
|
128 |
+
|
129 |
+
推理速度测算是在单卡 A100-SXM4-80G GPU上运行,使用PyTorch 2.0.1及CUDA 11.4。
|
130 |
+
|
131 |
+
The profiling runs on a single A100-SXM4-80G GPU with PyTorch 2.0.1 and CUDA 11.4.
|
132 |
+
|
133 |
+
### GPU显存占用 (GPU Memory Usage)
|
134 |
+
|
135 |
+
我们还测算了在一张图片输入的条件下BF16和Int4模型生成1792 (2048-258) 和 7934 (8192-258) 个token所需显存。结果如下所示:
|
136 |
+
|
137 |
+
We also profile the peak GPU memory usage for encoding 1792 (2048-258) tokens (including an image) as context (and generating single token) and generating 7934 (8192-258) tokens (with an image as context) under BF16 or Int4 quantization level, respectively. The results are shown below.
|
138 |
+
|
139 |
+
| Quantization | Peak Usage for Encoding 2048 Tokens | Peak Usage for Generating 8192 Tokens |
|
140 |
+
| ------------ | :---------------------------------: | :-----------------------------------: |
|
141 |
+
| BF16 | 22.60GB | 28.01GB |
|
142 |
+
| Int4 | 11.82GB | 17.23GB |
|
143 |
+
|
144 |
+
上述速度和显存测算使用[此脚本](https://qianwen-res.oss-cn-beijing.aliyuncs.com/profile_mm.py)完成。
|
145 |
+
|
146 |
+
The above speed and memory profiling are conducted using [this script](https://qianwen-res.oss-cn-beijing.aliyuncs.com/profile_mm.py).
|
147 |
+
<br>
|
148 |
+
|
149 |
+
## 评测
|
150 |
+
|
151 |
+
我们从两个角度评测了两个模型的能力:
|
152 |
+
|
153 |
+
1. 在**英文标准 Benchmark** 上评测模型的基础任务能力。目前评测了四大类多模态任务:
|
154 |
+
|
155 |
+
- Zero-shot Caption: 评测模型在未见过数据集上的零样本图片描述能力;
|
156 |
+
- General VQA: 评测模型的通用问答能力,例如判断题、颜色、个数、类目等问答能力;
|
157 |
+
- Text-based VQA:评测模型对于图片中文字相关的识别/问答能力,例如文档问答、图表问答、文字问答等;
|
158 |
+
- Referring Expression Compression:评测模型给定物体描述画检测框的能力;
|
159 |
+
2. **试金石 (TouchStone)**:为了评测模型整体的图文对话能力和人类对齐水平。我们为此构建了一个基于 GPT4 打分来评测 LVLM 模型的 Benchmark:TouchStone。在 TouchStone-v0.1 中:
|
160 |
+
|
161 |
+
- 评测基准总计涵盖 300+张图片、800+道题目、27个类别。包括基础属性问答、人物地标问答、影视作品问答、视觉推理、反事实推理、诗歌创作、故事写作,商品比较、图片解题等**尽可能广泛的类别**。
|
162 |
+
- 为了弥补目前 GPT4 无法直接读取图片的缺陷,我们给所有的带评测图片提供了**人工标注的充分详细描述**,并且将图片的详细描述、问题和模型的输出结果一起交给 GPT4 打分。
|
163 |
+
- 评测同时包含英文版本和中文版本。
|
164 |
+
|
165 |
+
评测结果如下:
|
166 |
+
|
167 |
+
We evaluated the model's ability from two perspectives:
|
168 |
+
|
169 |
+
1. **Standard Benchmarks**: We evaluate the model's basic task capabilities on four major categories of multimodal tasks:
|
170 |
+
|
171 |
+
- Zero-shot Caption: Evaluate model's zero-shot image captioning ability on unseen datasets;
|
172 |
+
- General VQA: Evaluate the general question-answering ability of pictures, such as the judgment, color, number, category, etc;
|
173 |
+
- Text-based VQA: Evaluate the model's ability to recognize text in pictures, such as document QA, chart QA, etc;
|
174 |
+
- Referring Expression Comprehension: Evaluate the ability to localize a target object in an image described by a referring expression.
|
175 |
+
2. **TouchStone**: To evaluate the overall text-image dialogue capability and alignment level with humans, we have constructed a benchmark called TouchStone, which is based on scoring with GPT4 to evaluate the LVLM model.
|
176 |
+
|
177 |
+
- The TouchStone benchmark covers a total of 300+ images, 800+ questions, and 27 categories. Such as attribute-based Q&A, celebrity recognition, writing poetry, summarizing multiple images, product comparison, math problem solving, etc;
|
178 |
+
- In order to break the current limitation of GPT4 in terms of direct image input, TouchStone provides fine-grained image annotations by human labeling. These detailed annotations, along with the questions and the model's output, are then presented to GPT4 for scoring.
|
179 |
+
- The benchmark includes both English and Chinese versions.
|
180 |
+
|
181 |
+
The results of the evaluation are as follows:
|
182 |
+
|
183 |
+
Qwen-VL outperforms current SOTA generalist models on multiple VL tasks and has a more comprehensive coverage in terms of capability range.
|
184 |
+
|
185 |
+
<p align="center">
|
186 |
+
<img src="https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/radar.png" width="600"/>
|
187 |
+
<p>
|
188 |
+
|
189 |
+
### 零样本图像描述 & 通用视觉问答 (Zero-shot Captioning & General VQA)
|
190 |
+
|
191 |
+
<table>
|
192 |
+
<thead>
|
193 |
+
<tr>
|
194 |
+
<th rowspan="2">Model type</th>
|
195 |
+
<th rowspan="2">Model</th>
|
196 |
+
<th colspan="2">Zero-shot Captioning</th>
|
197 |
+
<th colspan="5">General VQA</th>
|
198 |
+
</tr>
|
199 |
+
<tr>
|
200 |
+
<th>NoCaps</th>
|
201 |
+
<th>Flickr30K</th>
|
202 |
+
<th>VQAv2<sup>dev</sup></th>
|
203 |
+
<th>OK-VQA</th>
|
204 |
+
<th>GQA</th>
|
205 |
+
<th>SciQA-Img<br>(0-shot)</th>
|
206 |
+
<th>VizWiz<br>(0-shot)</th>
|
207 |
+
</tr>
|
208 |
+
</thead>
|
209 |
+
<tbody align="center">
|
210 |
+
<tr>
|
211 |
+
<td rowspan="10">Generalist<br>Models</td>
|
212 |
+
<td>Flamingo-9B</td>
|
213 |
+
<td>-</td>
|
214 |
+
<td>61.5</td>
|
215 |
+
<td>51.8</td>
|
216 |
+
<td>44.7</td>
|
217 |
+
<td>-</td>
|
218 |
+
<td>-</td>
|
219 |
+
<td>28.8</td>
|
220 |
+
</tr>
|
221 |
+
<tr>
|
222 |
+
<td>Flamingo-80B</td>
|
223 |
+
<td>-</td>
|
224 |
+
<td>67.2</td>
|
225 |
+
<td>56.3</td>
|
226 |
+
<td>50.6</td>
|
227 |
+
<td>-</td>
|
228 |
+
<td>-</td>
|
229 |
+
<td>31.6</td>
|
230 |
+
</tr>
|
231 |
+
<tr>
|
232 |
+
<td>Unified-IO-XL</td>
|
233 |
+
<td>100.0</td>
|
234 |
+
<td>-</td>
|
235 |
+
<td>77.9</td>
|
236 |
+
<td>54.0</td>
|
237 |
+
<td>-</td>
|
238 |
+
<td>-</td>
|
239 |
+
<td>-</td>
|
240 |
+
</tr>
|
241 |
+
<tr>
|
242 |
+
<td>Kosmos-1</td>
|
243 |
+
<td>-</td>
|
244 |
+
<td>67.1</td>
|
245 |
+
<td>51.0</td>
|
246 |
+
<td>-</td>
|
247 |
+
<td>-</td>
|
248 |
+
<td>-</td>
|
249 |
+
<td>29.2</td>
|
250 |
+
</tr>
|
251 |
+
<tr>
|
252 |
+
<td>Kosmos-2</td>
|
253 |
+
<td>-</td>
|
254 |
+
<td>66.7</td>
|
255 |
+
<td>45.6</td>
|
256 |
+
<td>-</td>
|
257 |
+
<td>-</td>
|
258 |
+
<td>-</td>
|
259 |
+
<td>-</td>
|
260 |
+
</tr>
|
261 |
+
<tr>
|
262 |
+
<td>BLIP-2 (Vicuna-13B)</td>
|
263 |
+
<td>103.9</td>
|
264 |
+
<td>71.6</td>
|
265 |
+
<td>65.0</td>
|
266 |
+
<td>45.9</td>
|
267 |
+
<td>32.3</td>
|
268 |
+
<td>61.0</td>
|
269 |
+
<td>19.6</td>
|
270 |
+
</tr>
|
271 |
+
<tr>
|
272 |
+
<td>InstructBLIP (Vicuna-13B)</td>
|
273 |
+
<td><strong>121.9</strong></td>
|
274 |
+
<td>82.8</td>
|
275 |
+
<td>-</td>
|
276 |
+
<td>-</td>
|
277 |
+
<td>49.5</td>
|
278 |
+
<td>63.1</td>
|
279 |
+
<td>33.4</td>
|
280 |
+
</tr>
|
281 |
+
<tr>
|
282 |
+
<td>Shikra (Vicuna-13B)</td>
|
283 |
+
<td>-</td>
|
284 |
+
<td>73.9</td>
|
285 |
+
<td>77.36</td>
|
286 |
+
<td>47.16</td>
|
287 |
+
<td>-</td>
|
288 |
+
<td>-</td>
|
289 |
+
<td>-</td>
|
290 |
+
</tr>
|
291 |
+
<tr>
|
292 |
+
<td><strong>Qwen-VL (Qwen-7B)</strong></td>
|
293 |
+
<td>121.4</td>
|
294 |
+
<td><b>85.8</b></td>
|
295 |
+
<td><b>78.8</b></td>
|
296 |
+
<td><b>58.6</b></td>
|
297 |
+
<td><b>59.3</b></td>
|
298 |
+
<td>67.1</td>
|
299 |
+
<td>35.2</td>
|
300 |
+
</tr>
|
301 |
+
<!-- <tr>
|
302 |
+
<td>Qwen-VL (4-shot)</td>
|
303 |
+
<td>-</td>
|
304 |
+
<td>-</td>
|
305 |
+
<td>-</td>
|
306 |
+
<td>63.6</td>
|
307 |
+
<td>-</td>
|
308 |
+
<td>-</td>
|
309 |
+
<td>39.1</td>
|
310 |
+
</tr> -->
|
311 |
+
<tr>
|
312 |
+
<td>Qwen-VL-Chat</td>
|
313 |
+
<td>120.2</td>
|
314 |
+
<td>81.0</td>
|
315 |
+
<td>78.2</td>
|
316 |
+
<td>56.6</td>
|
317 |
+
<td>57.5</td>
|
318 |
+
<td><b>68.2</b></td>
|
319 |
+
<td><b>38.9</b></td>
|
320 |
+
</tr>
|
321 |
+
<!-- <tr>
|
322 |
+
<td>Qwen-VL-Chat (4-shot)</td>
|
323 |
+
<td>-</td>
|
324 |
+
<td>-</td>
|
325 |
+
<td>-</td>
|
326 |
+
<td>60.6</td>
|
327 |
+
<td>-</td>
|
328 |
+
<td>-</td>
|
329 |
+
<td>44.45</td>
|
330 |
+
</tr> -->
|
331 |
+
<tr>
|
332 |
+
<td>Previous SOTA<br>(Per Task Fine-tuning)</td>
|
333 |
+
<td>-</td>
|
334 |
+
<td>127.0<br>(PALI-17B)</td>
|
335 |
+
<td>84.5<br>(InstructBLIP<br>-FlanT5-XL)</td>
|
336 |
+
<td>86.1<br>(PALI-X<br>-55B)</td>
|
337 |
+
<td>66.1<br>(PALI-X<br>-55B)</td>
|
338 |
+
<td>72.1<br>(CFR)</td>
|
339 |
+
<td>92.53<br>(LLaVa+<br>GPT-4)</td>
|
340 |
+
<td>70.9<br>(PALI-X<br>-55B)</td>
|
341 |
+
</tr>
|
342 |
+
</tbody>
|
343 |
+
</table>
|
344 |
+
|
345 |
+
- 在 Zero-shot Caption 中,Qwen-VL 在 Flickr30K 数据集上取得了 **SOTA** 的结果,并在 Nocaps 数据集上取得了和 InstructBlip 可竞争的结果。
|
346 |
+
- 在 General VQA 中,Qwen-VL 取得了 LVLM 模型同等量级和设定下 **SOTA** 的结果。
|
347 |
+
- For zero-shot image captioning, Qwen-VL achieves the **SOTA** on Flickr30K and competitive results on Nocaps with InstructBlip.
|
348 |
+
- For general VQA, Qwen-VL achieves the **SOTA** under the same generalist LVLM scale settings.
|
349 |
+
|
350 |
+
### 文本导向的视觉问答 (Text-oriented VQA)
|
351 |
+
|
352 |
+
<table>
|
353 |
+
<thead>
|
354 |
+
<tr>
|
355 |
+
<th>Model type</th>
|
356 |
+
<th>Model</th>
|
357 |
+
<th>TextVQA</th>
|
358 |
+
<th>DocVQA</th>
|
359 |
+
<th>ChartQA</th>
|
360 |
+
<th>AI2D</th>
|
361 |
+
<th>OCR-VQA</th>
|
362 |
+
</tr>
|
363 |
+
</thead>
|
364 |
+
<tbody align="center">
|
365 |
+
<tr>
|
366 |
+
<td rowspan="5">Generalist Models</td>
|
367 |
+
<td>BLIP-2 (Vicuna-13B)</td>
|
368 |
+
<td>42.4</td>
|
369 |
+
<td>-</td>
|
370 |
+
<td>-</td>
|
371 |
+
<td>-</td>
|
372 |
+
<td>-</td>
|
373 |
+
</tr>
|
374 |
+
<tr>
|
375 |
+
<td>InstructBLIP (Vicuna-13B)</td>
|
376 |
+
<td>50.7</td>
|
377 |
+
<td>-</td>
|
378 |
+
<td>-</td>
|
379 |
+
<td>-</td>
|
380 |
+
<td>-</td>
|
381 |
+
</tr>
|
382 |
+
<tr>
|
383 |
+
<td>mPLUG-DocOwl (LLaMA-7B)</td>
|
384 |
+
<td>52.6</td>
|
385 |
+
<td>62.2</td>
|
386 |
+
<td>57.4</td>
|
387 |
+
<td>-</td>
|
388 |
+
<td>-</td>
|
389 |
+
</tr>
|
390 |
+
<tr>
|
391 |
+
<td>Pic2Struct-Large (1.3B)</td>
|
392 |
+
<td>-</td>
|
393 |
+
<td><b>76.6</b></td>
|
394 |
+
<td>58.6</td>
|
395 |
+
<td>42.1</td>
|
396 |
+
<td>71.3</td>
|
397 |
+
</tr>
|
398 |
+
<tr>
|
399 |
+
<td>Qwen-VL (Qwen-7B)</td>
|
400 |
+
<td><b>63.8</b></td>
|
401 |
+
<td>65.1</td>
|
402 |
+
<td><b>65.7</b></td>
|
403 |
+
<td><b>62.3</b></td>
|
404 |
+
<td><b>75.7</b></td>
|
405 |
+
</tr>
|
406 |
+
<tr>
|
407 |
+
<td>Specialist SOTAs<br>(Specialist/Finetuned)</td>
|
408 |
+
<td>PALI-X-55B (Single-task FT)<br>(Without OCR Pipeline)</td>
|
409 |
+
<td>71.44</td>
|
410 |
+
<td>80.0</td>
|
411 |
+
<td>70.0</td>
|
412 |
+
<td>81.2</td>
|
413 |
+
<td>75.0</td>
|
414 |
+
</tr>
|
415 |
+
</tbody>
|
416 |
+
</table>
|
417 |
+
|
418 |
+
- 在文字相关的识别/问答评测上,取得了当前规模下通用 LVLM 达到的最好结果。
|
419 |
+
- 分辨率对上述某几个评测非常重要,大部分 224 分辨率的开源 LVLM 模型无法完成以上评测,或只能通过切图的方式解决。Qwen-VL 将分辨率提升到 448,可以直接以端到端的方式进行以上评测。Qwen-VL 在很多任务上甚至超过了 1024 分辨率的 Pic2Struct-Large 模型。
|
420 |
+
- In text-related recognition/QA evaluation, Qwen-VL achieves the SOTA under the generalist LVLM scale settings.
|
421 |
+
- Resolution is important for several above evaluations. While most open-source LVLM models with 224 resolution are incapable of these evaluations or can only solve these by cutting images, Qwen-VL scales the resolution to 448 so that it can be evaluated end-to-end. Qwen-VL even outperforms Pic2Struct-Large models of 1024 resolution on some tasks.
|
422 |
+
|
423 |
+
### 细粒度视觉定位 (Referring Expression Comprehension)
|
424 |
+
|
425 |
+
<table>
|
426 |
+
<thead>
|
427 |
+
<tr>
|
428 |
+
<th rowspan="2">Model type</th>
|
429 |
+
<th rowspan="2">Model</th>
|
430 |
+
<th colspan="3">RefCOCO</th>
|
431 |
+
<th colspan="3">RefCOCO+</th>
|
432 |
+
<th colspan="2">RefCOCOg</th>
|
433 |
+
<th>GRIT</th>
|
434 |
+
</tr>
|
435 |
+
<tr>
|
436 |
+
<th>val</th>
|
437 |
+
<th>test-A</th>
|
438 |
+
<th>test-B</th>
|
439 |
+
<th>val</th>
|
440 |
+
<th>test-A</th>
|
441 |
+
<th>test-B</th>
|
442 |
+
<th>val-u</th>
|
443 |
+
<th>test-u</th>
|
444 |
+
<th>refexp</th>
|
445 |
+
</tr>
|
446 |
+
</thead>
|
447 |
+
<tbody align="center">
|
448 |
+
<tr>
|
449 |
+
<td rowspan="8">Generalist Models</td>
|
450 |
+
<td>GPV-2</td>
|
451 |
+
<td>-</td>
|
452 |
+
<td>-</td>
|
453 |
+
<td>-</td>
|
454 |
+
<td>-</td>
|
455 |
+
<td>-</td>
|
456 |
+
<td>-</td>
|
457 |
+
<td>-</td>
|
458 |
+
<td>-</td>
|
459 |
+
<td>51.50</td>
|
460 |
+
</tr>
|
461 |
+
<tr>
|
462 |
+
<td>OFA-L*</td>
|
463 |
+
<td>79.96</td>
|
464 |
+
<td>83.67</td>
|
465 |
+
<td>76.39</td>
|
466 |
+
<td>68.29</td>
|
467 |
+
<td>76.00</td>
|
468 |
+
<td>61.75</td>
|
469 |
+
<td>67.57</td>
|
470 |
+
<td>67.58</td>
|
471 |
+
<td>61.70</td>
|
472 |
+
</tr>
|
473 |
+
<tr>
|
474 |
+
<td>Unified-IO</td>
|
475 |
+
<td>-</td>
|
476 |
+
<td>-</td>
|
477 |
+
<td>-</td>
|
478 |
+
<td>-</td>
|
479 |
+
<td>-</td>
|
480 |
+
<td>-</td>
|
481 |
+
<td>-</td>
|
482 |
+
<td>-</td>
|
483 |
+
<td><b>78.61</b></td>
|
484 |
+
</tr>
|
485 |
+
<tr>
|
486 |
+
<td>VisionLLM-H</td>
|
487 |
+
<td></td>
|
488 |
+
<td>86.70</td>
|
489 |
+
<td>-</td>
|
490 |
+
<td>-</td>
|
491 |
+
<td>-</td>
|
492 |
+
<td>-</td>
|
493 |
+
<td>-</td>
|
494 |
+
<td>-</td>
|
495 |
+
<td>-</td>
|
496 |
+
</tr>
|
497 |
+
<tr>
|
498 |
+
<td>Shikra-7B</td>
|
499 |
+
<td>87.01</td>
|
500 |
+
<td>90.61</td>
|
501 |
+
<td>80.24 </td>
|
502 |
+
<td>81.60</td>
|
503 |
+
<td>87.36</td>
|
504 |
+
<td>72.12</td>
|
505 |
+
<td>82.27</td>
|
506 |
+
<td>82.19</td>
|
507 |
+
<td>69.34</td>
|
508 |
+
</tr>
|
509 |
+
<tr>
|
510 |
+
<td>Shikra-13B</td>
|
511 |
+
<td>87.83 </td>
|
512 |
+
<td>91.11</td>
|
513 |
+
<td>81.81</td>
|
514 |
+
<td>82.89</td>
|
515 |
+
<td>87.79</td>
|
516 |
+
<td>74.41</td>
|
517 |
+
<td>82.64</td>
|
518 |
+
<td>83.16</td>
|
519 |
+
<td>69.03</td>
|
520 |
+
</tr>
|
521 |
+
<tr>
|
522 |
+
<td>Qwen-VL-7B</td>
|
523 |
+
<td><b>89.36</b></td>
|
524 |
+
<td>92.26</td>
|
525 |
+
<td><b>85.34</b></td>
|
526 |
+
<td><b>83.12</b></td>
|
527 |
+
<td>88.25</td>
|
528 |
+
<td><b>77.21</b></td>
|
529 |
+
<td>85.58</td>
|
530 |
+
<td>85.48</td>
|
531 |
+
<td>78.22</td>
|
532 |
+
</tr>
|
533 |
+
<tr>
|
534 |
+
<td>Qwen-VL-7B-Chat</td>
|
535 |
+
<td>88.55</td>
|
536 |
+
<td><b>92.27</b></td>
|
537 |
+
<td>84.51</td>
|
538 |
+
<td>82.82</td>
|
539 |
+
<td><b>88.59</b></td>
|
540 |
+
<td>76.79</td>
|
541 |
+
<td><b>85.96</b></td>
|
542 |
+
<td><b>86.32</b></td>
|
543 |
+
<td>-</td>
|
544 |
+
<tr>
|
545 |
+
<td rowspan="3">Specialist SOTAs<br>(Specialist/Finetuned)</td>
|
546 |
+
<td>G-DINO-L</td>
|
547 |
+
<td>90.56 </td>
|
548 |
+
<td>93.19</td>
|
549 |
+
<td>88.24</td>
|
550 |
+
<td>82.75</td>
|
551 |
+
<td>88.95</td>
|
552 |
+
<td>75.92</td>
|
553 |
+
<td>86.13</td>
|
554 |
+
<td>87.02</td>
|
555 |
+
<td>-</td>
|
556 |
+
</tr>
|
557 |
+
<tr>
|
558 |
+
<td>UNINEXT-H</td>
|
559 |
+
<td>92.64 </td>
|
560 |
+
<td>94.33</td>
|
561 |
+
<td>91.46</td>
|
562 |
+
<td>85.24</td>
|
563 |
+
<td>89.63</td>
|
564 |
+
<td>79.79</td>
|
565 |
+
<td>88.73</td>
|
566 |
+
<td>89.37</td>
|
567 |
+
<td>-</td>
|
568 |
+
</tr>
|
569 |
+
<tr>
|
570 |
+
<td>ONE-PEACE</td>
|
571 |
+
<td>92.58 </td>
|
572 |
+
<td>94.18</td>
|
573 |
+
<td>89.26</td>
|
574 |
+
<td>88.77</td>
|
575 |
+
<td>92.21</td>
|
576 |
+
<td>83.23</td>
|
577 |
+
<td>89.22</td>
|
578 |
+
<td>89.27</td>
|
579 |
+
<td>-</td>
|
580 |
+
</tr>
|
581 |
+
</tbody>
|
582 |
+
</table>
|
583 |
+
|
584 |
+
- 在定位任务上,Qwen-VL 全面超过 Shikra-13B,取得了目前 Generalist LVLM 模型上在 Refcoco 上的 **SOTA**。
|
585 |
+
- Qwen-VL 并没有在任何中文定位数据上训练过,但通过中文 Caption 数据和 英文 Grounding 数据的训练,可以 Zero-shot 泛化出中文 Grounding 能力。
|
586 |
+
|
587 |
+
我们提供了以上**所有**评测脚本以供复现我们的实验结果。请阅读 [eval/EVALUATION.md](eval/EVALUATION.md) 了解更多信息。
|
588 |
+
|
589 |
+
- Qwen-VL achieves the **SOTA** in all above referring expression comprehension benchmarks.
|
590 |
+
- Qwen-VL has not been trained on any Chinese grounding data, but it can still generalize to the Chinese Grounding tasks in a zero-shot way by training Chinese Caption data and English Grounding data.
|
591 |
+
|
592 |
+
We provide all of the above evaluation scripts for reproducing our experimental results. Please read [eval/EVALUATION.md](eval/EVALUATION.md) for more information.
|
593 |
+
|
594 |
+
### 闲聊能力测评 (Chat Evaluation)
|
595 |
+
|
596 |
+
TouchStone 是一个基于 GPT4 打分来评测 LVLM 模型的图文对话能力和人类对齐水平的基准。它涵盖了 300+张图片、800+道题目、27个类别,包括基础属性、人物地标、视觉推理、诗歌创作、故事写作、商品比较、图片解题等**尽可能广泛的类别**。关于 TouchStone 的详细介绍,请参考[touchstone/README_CN.md](touchstone/README_CN.md)了解更多信息。
|
597 |
+
|
598 |
+
TouchStone is a benchmark based on scoring with GPT4 to evaluate the abilities of the LVLM model on text-image dialogue and alignment levels with humans. It covers a total of 300+ images, 800+ questions, and 27 categories, such as attribute-based Q&A, celebrity recognition, writing poetry, summarizing multiple images, product comparison, math problem solving, etc. Please read [touchstone/README_CN.md](touchstone/README.md) for more information.
|
599 |
+
|
600 |
+
#### 英语 (English)
|
601 |
+
|
602 |
+
| Model | Score |
|
603 |
+
|---------------|-------|
|
604 |
+
| PandaGPT | 488.5 |
|
605 |
+
| MiniGPT4 | 531.7 |
|
606 |
+
| InstructBLIP | 552.4 |
|
607 |
+
| LLaMA-AdapterV2 | 590.1 |
|
608 |
+
| mPLUG-Owl | 605.4 |
|
609 |
+
| LLaVA | 602.7 |
|
610 |
+
| Qwen-VL-Chat | 645.2 |
|
611 |
+
|
612 |
+
#### 中文 (Chinese)
|
613 |
+
|
614 |
+
| Model | Score |
|
615 |
+
|---------------|-------|
|
616 |
+
| VisualGLM | 247.1 |
|
617 |
+
| Qwen-VL-Chat | 401.2 |
|
618 |
+
|
619 |
+
Qwen-VL-Chat 模型在中英文的对齐评测中均取得当前 LVLM 模型下的最好结果。
|
620 |
+
|
621 |
+
Qwen-VL-Chat has achieved the best results in both Chinese and English alignment evaluation.
|
622 |
+
<br>
|
623 |
+
|
624 |
+
## 常见问题 (FAQ)
|
625 |
+
|
626 |
+
如遇到问题,敬请查阅 [FAQ](https://github.com/QwenLM/Qwen-VL/blob/master/FAQ_zh.md)以及issue区,如仍无法解决再提交issue。
|
627 |
+
|
628 |
+
If you meet problems, please refer to [FAQ](https://github.com/QwenLM/Qwen-VL/blob/master/FAQ.md) and the issues first to search a solution before you launch a new issue.
|
629 |
+
<br>
|
630 |
+
|
631 |
+
## 使用协议 (License Agreement)
|
632 |
+
|
633 |
+
研究人员与开发者可使用Qwen-VL和Qwen-VL-Chat或进行二次开发。我们同样允许商业使用,具体细节请查看[LICENSE](https://github.com/QwenLM/Qwen-VL/blob/master/LICENSE)。如需商用,请填写[问卷](https://dashscope.console.aliyun.com/openModelApply/qianwen)申请。
|
634 |
+
|
635 |
+
Researchers and developers are free to use the codes and model weights of both Qwen-VL and Qwen-VL-Chat. We also allow their commercial use. Check our license at [LICENSE](LICENSE) for more details.
|
636 |
+
<br>
|
637 |
+
|
638 |
+
## 引用 (Citation)
|
639 |
+
|
640 |
+
如果你觉得我们的论文和代码对你的研究有帮助,请考虑:star: 和引用 :pencil: :)
|
641 |
+
|
642 |
+
If you find our paper and code useful in your research, please consider giving a star :star: and citation :pencil: :)
|
643 |
+
|
644 |
+
```BibTeX
|
645 |
+
@article{Qwen-VL,
|
646 |
+
title={Qwen-VL: A Frontier Large Vision-Language Model with Versatile Abilities},
|
647 |
+
author={Bai, Jinze and Bai, Shuai and Yang, Shusheng and Wang, Shijie and Tan, Sinan and Wang, Peng and Lin, Junyang and Zhou, Chang and Zhou, Jingren},
|
648 |
+
journal={arXiv preprint arXiv:2308.12966},
|
649 |
+
year={2023}
|
650 |
+
}
|
651 |
+
```
|
652 |
+
<br>
|
653 |
+
|
654 |
+
## 联系我们 (Contact Us)
|
655 |
+
|
656 |
+
如果你想给我们的研发团队和产品团队留言,请通过邮件([email protected])联系我们。
|
657 |
+
|
658 |
+
If you are interested to leave a message to either our research team or product team, feel free to send an email to [email protected].
|
659 |
+
|
660 |
+
```
|
661 |
+
|
662 |
+
```
|
663 |
+
|