mirror of
https://github.com/OpenBMB/MiniCPM-V.git
synced 2026-02-04 17:59:18 +08:00
update readme
This commit is contained in:
104
README_zh.md
104
README_zh.md
@@ -4,7 +4,7 @@
|
||||
|
||||
<img src="./assets/title-2.png" width="200em" ></img>
|
||||
|
||||
**性能强大且部署高效的多模态大模型**
|
||||
**性能领先且部署高效的多模态大模型**
|
||||
<p align="center">
|
||||
OmniLMM-3B <a href="https://huggingface.co/openbmb/MiniCPM-V/">🤗</a> <a href="http://120.92.209.146:80/">🤖</a> |
|
||||
OmniLMM-12B <a href="https://huggingface.co/openbmb/OmniLMM-12B/">🤗</a> <a href="http://120.92.209.146:8081">🤖</a>
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
**OmniLMM** 是一系列善于处理图文输入的开源多模态大模型(LMMs)。该系列模型接受图像和文本输入,并提供高质量的文本输出。我们发布了两个版本的 OmniLMM,旨在实现**强大的性能和高效的部署**:
|
||||
**OmniLMM** 是面向图文理解的开源多模态大模型系列。该系列模型接受图像和文本输入,并提供高质量的文本输出。我们发布了两个版本的 OmniLMM,旨在实现**领先的性能和高效的部署**:
|
||||
|
||||
- **OmniLMM-12B**:相比同规模其他模型在多个基准测试中具有领先性能。
|
||||
|
||||
@@ -22,29 +22,49 @@
|
||||
[English Document](./README.md)
|
||||
|
||||
## 目录
|
||||
<!-- TOC -->
|
||||
|
||||
- [目录](#目录)
|
||||
- [OmniLMM-12B](#omnilmm-12b)
|
||||
- [性能评估](#性能评估)
|
||||
- [样例展示](#样例展示)
|
||||
- [OmniLMM-3B](#omnilmm-3b)
|
||||
- [体验](#demo)
|
||||
- [安装](#install)
|
||||
- [推理](#inference)
|
||||
- [模型库](#model-zoo)
|
||||
- [性能评估](#性能评估-1)
|
||||
- [样例展示](#样例展示-1)
|
||||
- [体验](#体验)
|
||||
- [安装](#安装)
|
||||
- [推理](#推理)
|
||||
- [模型库](#模型库)
|
||||
- [多轮对话](#多轮对话)
|
||||
- [✅ 未来计划](#-未来计划)
|
||||
- [模型协议](#模型协议)
|
||||
- [声明](#声明)
|
||||
- [🏫 机构](#-机构)
|
||||
|
||||
<!-- /TOC -->
|
||||
<!-- /TOC -->
|
||||
## OmniLMM-12B
|
||||
**OmniLMM-12B** 是当前系列中性能最强大的版本。该模型使用一个感知重采样层连接 EVA02-5B 和 Zephyr-7B-β 来构建,采用了课程学习的方法在多模态数据上进行训练。该模型具有三个显著特征:
|
||||
**OmniLMM-12B** 是当前系列中性能最佳的版本。该模型基于EVA02-5B和Zephyr-7B-β初始化构建,并使用perceiver resampler连接,采用了课程学习的方法在多模态数据上进行训练。该模型具有三个特点:
|
||||
|
||||
- 🔥 **卓越性能。**
|
||||
- 🔥 **性能领先。**
|
||||
|
||||
OmniLMM-12B 相比其他同规模模型在多个基准测试中取得**领先的性能**(包括 MME、MMBench、SEED-Bench 等)。模型掌握了**丰富的多模态世界知识**。
|
||||
OmniLMM-12B 相比其他同规模模型在多个基准测试中取得**领先的性能**(包括 MME、MMBench、SEED-Bench 等),模型掌握了较为丰富的多模态世界知识。
|
||||
|
||||
- 🏆 **可信行为。**
|
||||
- 🏆 **行为可信。**
|
||||
|
||||
LMMs 的幻觉问题备受关注,模型经常生成和图像中的事实不符的文本(例如,确信地描述图片中并不存在的物体)。OmniLMM-12B是 **第一个通过多模态 RLHF 对齐的综合能力优秀的开源多模态大模型**(通过我们最近提出的 [RLHF-V](https://rlhf-v.github.io/) 技术)。该模型在 [MMHal-Bench](https://huggingface.co/datasets/Shengcao1006/MMHal-Bench) 幻觉评测基准上位列开源模型中**第一**,并在 [Object HalBench](https://arxiv.org/abs/2312.00849) 中**超过了 GPT-4V**。
|
||||
多模态大模型的幻觉问题备受关注,模型经常生成和图像中的事实不符的文本(例如,确信地描述图片中并不存在的物体)。OmniLMM-12B是 **第一个通过多模态 RLHF 对齐的综合能力优秀的开源多模态大模型**(借助我们最近提出的 [RLHF-V](https://rlhf-v.github.io/) 技术)。该模型在 [MMHal-Bench](https://huggingface.co/datasets/Shengcao1006/MMHal-Bench) 幻觉评测基准上达到**开源模型最佳水平**,并在 [Object HalBench](https://arxiv.org/abs/2312.00849) 中**优于GPT-4V**。
|
||||
|
||||
- 🕹 **实时多模态交互。**
|
||||
|
||||
我们将 OmniLMM-12B 和 GPT-3.5 结合成一个**实时多模态交互助手**。该助手接受来自相机的视频流和来自麦克风的语音流,并发出语音输出。虽然还处于初级阶段,但我们也发现该模型**无需视频编辑**就可以**复现出现在 Gemini 演示视频中的一些有趣例子**。
|
||||
我们尝试结合OmniLMM-12B和GPT-3.5 (纯文本模型) ,实现**实时多模态交互助手**。该模型接受来自摄像头的视频流,并借助工具处理语音输入输出。虽然还很初步,我们发现该模型无需视频编辑可以**复现Gemini演示视频中的一些有趣例子**。
|
||||
|
||||
### 性能评估
|
||||
### 评测结果
|
||||
|
||||
<div align="center">
|
||||
<img src=assets/eval_radar.png width=50% />
|
||||
</div>
|
||||
<details>
|
||||
<summary> MME, MMBench, MMMU, MMBench, MMHal-Bench, Object HalBench, SeedBench, LLaVA Bench W, MathVista 上的详细评测结果. </summary>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
@@ -149,7 +169,22 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<small>†: 闭源模型</small>
|
||||
</details>
|
||||
|
||||
### 典型示例
|
||||
|
||||
<table align="center" >
|
||||
<p align="center" >
|
||||
<img src="assets/omnilmm-12b-examples_2.png" />
|
||||
</p>
|
||||
</table>
|
||||
|
||||
|
||||
我们结合 OmniLMM-12B 和 ChatGPT-3.5 (纯文本模型) 尝试构建 **实时多模态交互助手**. OmniLMM-12B 将视频帧转为对应的图像描述并输入给ChatGPT-3.5来生成对用户指令的响应。演示视频未经编辑。
|
||||
|
||||
<div align="center" >
|
||||
<video controls src="https://github.com/OpenBMB/OmniLMM/assets/157115220/c1fd3562-1ab1-4534-8139-79e9137b5398" type="video/mp4" width=80%/>
|
||||
</div>
|
||||
|
||||
## OmniLMM-3B
|
||||
|
||||
@@ -167,7 +202,7 @@
|
||||
|
||||
OmniLMM-3B 是**第一个支持英语和中文双语多模态交互的终端可部署 LMM**。这是通过跨语言泛化多模态能力实现的,这是我们 ICLR 2024 [spotlight 论文](https://arxiv.org/abs/2308.12038)中的一项技术。
|
||||
|
||||
### Evaluation
|
||||
### 性能评估
|
||||
|
||||
<div align="center">
|
||||
|
||||
@@ -253,7 +288,7 @@
|
||||
|
||||
## 体验
|
||||
|
||||
你可以通过以下链接尝试使用我们的网页端推理服务: [OmniLMM-12B](http://120.92.209.146:8081) | [OmniLMM-3B](http://120.92.209.146:80).
|
||||
你可以通过以下链接使用我们的网页端推理服务: [OmniLMM-12B](http://120.92.209.146:8081) | [OmniLMM-3B](http://120.92.209.146:80).
|
||||
|
||||
## 安装
|
||||
|
||||
@@ -283,8 +318,8 @@ pip install -r requirements.txt
|
||||
|
||||
| 模型 | 简介 | 下载链接 |
|
||||
|:----------------------|:-------------------|:---------------:|
|
||||
| OmniLMM-12B | 更强大的性能表现 | [🤗](https://huggingface.co/openbmb/OmniLMM-12B) <a url="https://modelscope.cn/models/OpenBMB/OmniLMM-12B/files"> <img src="./assets/modelscope_logo.png" width="20px"></img></a> |
|
||||
| OmniLMM-3B | 支持终端设备上的高效部署,性能优秀 | [🤗](https://huggingface.co/openbmb/MiniCPM-V) <a url="https://modelscope.cn/models/OpenBMB/MiniCPM-V/files"> <img src="./assets/modelscope_logo.png" width="20px"></img></a> |
|
||||
| OmniLMM-12B | 更强大的性能表现 | [🤗](https://huggingface.co/openbmb/OmniLMM-12B) [<img src="./assets/modelscope_logo.png" width="20px"></img>](https://modelscope.cn/models/OpenBMB/OmniLMM-12B/files) |
|
||||
| OmniLMM-3B | 支持终端设备上的高效部署,性能优秀 | [🤗](https://huggingface.co/openbmb/MiniCPM-V) [<img src="./assets/modelscope_logo.png" width="20px"></img>](https://modelscope.cn/models/OpenBMB/MiniCPM-V/files) |
|
||||
|
||||
|
||||
### 多轮对话
|
||||
@@ -295,17 +330,16 @@ pip install -r requirements.txt
|
||||
<img src="assets/COCO_test2015_000000262144.jpg" width="660px">
|
||||
</div>
|
||||
|
||||
##### OmniLMM-12B
|
||||
|
||||
```python
|
||||
from chat import OmniLMMChat, img2base64
|
||||
|
||||
chat_model = OmniLMMChat('openbmb/OmniLMM-12B')
|
||||
chat_model = OmniLMMChat('openbmb/OmniLMM-12B') # or 'openbmb/MiniCPM-V'
|
||||
|
||||
im_64 = img2base64('./assets/COCO_test2015_000000262144.jpg')
|
||||
|
||||
# First round chat
|
||||
msgs = [{"role": "user", "content": "What are the people doing?"}]
|
||||
msgs = [{"role": "user", "content": "What are the people doing?"}] # or Chinese input [{"role": "user", "content": "请描述一下图像"}]
|
||||
|
||||
inputs = {"image": im_64, "question": json.dumps(msgs)}
|
||||
answer = chat_model.process(inputs)
|
||||
@@ -321,37 +355,13 @@ answer = chat_model.process(inputs)
|
||||
print(answer)
|
||||
```
|
||||
|
||||
We can obtain the following results:
|
||||
可以得到以下输出:
|
||||
```
|
||||
"The people in the image are playing baseball. One person is pitching a ball, another one is swinging a bat to hit it, and there's also an umpire present who appears to be watching the game closely."
|
||||
|
||||
"The image depicts a baseball game in progress. A pitcher is throwing the ball, while another player is swinging his bat to hit it. An umpire can be seen observing the play closely."
|
||||
```
|
||||
|
||||
##### OmniLMM-3B
|
||||
```python
|
||||
import torch
|
||||
from PIL import Image
|
||||
from transformers import AutoModel, AutoTokenizer
|
||||
|
||||
model_path='openbmb/MiniCPM-V'
|
||||
model = AutoModel.from_pretrained(model_path, trust_remote_code=True).to(dtype=torch.bfloat16)
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
|
||||
model.eval().cuda()
|
||||
|
||||
image = Image.open('./assets/COCO_test2015_000000262144.jpg').convert('RGB')
|
||||
|
||||
question = '请描述一下该图像'
|
||||
res, context, _ = model.chat(
|
||||
image=image,
|
||||
question=question,
|
||||
context=None,
|
||||
tokenizer=tokenizer,
|
||||
sampling=True,
|
||||
temperature=0.7
|
||||
)
|
||||
print(res)
|
||||
```
|
||||
|
||||
## ✅ 未来计划
|
||||
|
||||
@@ -376,9 +386,7 @@ OmniLMMs 模型权重对学术研究完全开放。
|
||||
|
||||
作为多模态大模型,OmniLMMs 通过学习大量的多模态语料来生成内容,但它无法理解、表达个人观点或价值判断,它所输出的任何内容都不代表模型开发者的观点和立场。
|
||||
|
||||
因此用户在使用 OmniLMMs 生成的内容时,应自行负责对其进行评估和验证。
|
||||
|
||||
如果由于使用 OmniLMMs 开源模型而导致的任何问题,包括但不限于数据安全问题、公共舆论风险,或模型被误导、滥用、传播或不当利用所带来的任何风险和问题,我们将不承担任何责任。
|
||||
因此用户在使用 OmniLMMs 生成的内容时,应自行负责对其进行评估和验证。如果由于使用 OmniLMMs 开源模型而导致的任何问题,包括但不限于数据安全问题、公共舆论风险,或模型被误导、滥用、传播或不当利用所带来的任何风险和问题,我们将不承担任何责任。
|
||||
|
||||
|
||||
## 🏫 机构
|
||||
|
||||
Reference in New Issue
Block a user