Large multi-modal models for strong performance and efficient deployment
OmniLMM is a family of open-source large multimodal models (LMMs) adept at vision & language modeling. The model processes images and text inputs and delivers high-quality text outputs. We release two featured versions of OmniLMM that are targeted at strong performance and efficient deployment:
-
OmniLMM-12B: Leading performance among comparable-sized models on multiple benchmarks.
-
OmniLMM-3B: Frontier end device multi-modal conversation with promising performance.
OmniLMM-12B is the most capable version. The model is built based on EVA02-5B and Zephyr-7B-β, connected with a perceiver resampler layer, and trained on multimodal data in a curriculum fashion. The model has three notable features:
-
🔥 Strong Performance.
OmniLMM-12B achieves leading performance among models with comparable sizes, surpassing established LMMs on multiple benchmarks (including MME, MMBench, SEED-Bench, etc). The model also supports OCR capability and endows rich multimodal world knowledge.
-
🏆 Trustworthy Behavior.
LMMs are known for suffering from hallucination, often generating text that is not factually grounded in images (e.g., faithfully describing non-existing objects in images). OmniLMM-12B is the first state-of-the-art open-source LMM aligned via multimodal RLHF for trustworthy behavior (using our recent RLHF-V technique). It ranks #1 among open-source models on MMHal-Bench, and outperforms GPT-4V on Object HalBench.
-
🕹 Real-time Multimodal Interaction.
We combine the OmniLMM-12B and GPT-3.5 (text-only) into a real-time multimodal interactive assistant. The assistant accepts video streams from the camera and speech streams from the microphone and emits speech output. While still primary, we find the model can replicate some of the fun cases shown in the Gemini Demo video, without any video edition.
Model | Size | MME | MMB dev (en) | MMMU val | MMHal-Bench | Object HalBench | SeedBench-I | MathVista | LLaVA Bench W |
---|---|---|---|---|---|---|---|---|---|
GPT-4V† | - | 1409 | 75.1 | 56.8 | 3.53 / 70.8 | 86.4 / 92.7 | 71.6 | 47.8 | 93.1 |
Qwen-VL-Plus† | - | 1681 | 66.2 | 45.2 | - | - | 65.7 | 36.0 | 73.7 |
Yi-VL 6B | 6.7B | - | 68.2 | 39.1 | - | - | 66.1 | 28.0 | 39.9 |
Qwen-VL-Chat | 9.6B | 1488 | 60.6 | 35.9 | 2.93 / 59.4 | 56.2 / 80.0 | 64.8 | 33.8 | 67.7 |
CogVLM | 17.4B | 1438 | 63.7 | 32.1 | 2.68 / 52.1 | 73.6 / 87.4 | 68.8 | 34.7 | 73.9 |
LLaVA 1.5 | 13.6B | 1531 | 68.2 | 36.4 | 2.71 / 51.0 | 53.7 / 77.4 | 68.1 | 26.4 | 64.6 |
OmniLMM-12B | 11.6B | 1637 | 71.6 | 40.7 | 3.45 / 68.8 | 90.3 / 95.5 | 71.1 | 34.9 | 72.0 |
We combine the OmniLMM-12B and GPT-3.5 (text-only) into a real-time multimodal interactive assistant. Video frames are described in text using OmniLMM-12B, and ChatGPT 3.5 (text-only) is employed to generate response according to the descriptions and user prompts. The demo video is a raw recording without edition.
demo_video.mp4
OmniLMM-3B (i.e., MiniCPM-V) is an efficient version with promising performance for deployment. The model is built based on SigLip-400M and MiniCPM-2.4B, connected by a perceiver resampler. Notable features of OmniLMM-3B include:
-
⚡️ High Efficiency.
OmniLMM-3B can be efficiently deployed on most GPU cards and personal computers, and even on end devices such as mobile phones. In terms of visual encoding, we compress the image representations into 64 tokens via a perceiver resampler, which is significantly fewer than other LMMs based on MLP architecture (typically > 512 tokens). This allows OmniLMM-3B to operate with much less memory cost and higher speed during inference.
-
🔥 Promising Performance.
OmniLMM-3B achieves state-of-the-art performance on multiple benchmarks (including MMMU, MME, and MMbech, etc) among models with comparable sizes, surpassing existing LMMs built on Phi-2. It even achieves comparable or better performance than the 9.6B Qwen-VL-Chat.
-
🙌 Bilingual Support.
OmniLMM-3B is the first edge-deployable LMM supporting bilingual multimodal interaction in English and Chinese. This is achieved by generalizing multimodal capabilities across languages, a technique from our ICLR 2024 spotlight paper.
Model | Size | MME | MMB dev (en) | MMB dev (zh) | MMMU val | CMMMU val |
---|---|---|---|---|---|---|
LLaVA-Phi | 3B | 1335 | 59.8 | - | - | - |
MobileVLM | 3B | 1289 | 59.6 | - | - | - |
Imp-v1 | 3B | 1434 | 66.5 | - | - | - |
Qwen-VL-Chat | 9.6B | 1487 | 60.6 | 56.7 | 35.9 | 30.7 |
CogVLM | 17.4B | 1438 | 63.7 | 53.8 | 32.1 | - |
OmniLMM-3B | 3B | 1452 | 67.3 | 61.9 | 34.7 | 32.1 |
OmniLLM-3B is the first LMM deloyed on end devices. The demo video is the raw screen recording on a OnePlus 9R without edition.
Click here to try out the Demo of OmniLMM-12B and OmniLMM-3B.
- Clone this repository and navigate to the source folder
git clone https://github.com/OpenBMB/OmniLMM.git
cd OmniLMM
- Create conda environment
conda create -n OmniLMM python=3.10 -y
conda activate OmniLMM
- Install dependencies
pip install -r requirements.txt
Model | Description | Download Link |
---|---|---|
OmniLMM-12B | The most capable version with strong performance. | 🤗 ![]() |
OmniLMM-3B | The efficient version for end device deployment. | 🤗 ![]() |
Please refer to the following codes to run OmniLMM
.
from chat import OmniLMMChat, img2base64
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?"}]
inputs = {"image": im_64, "question": json.dumps(msgs)}
answer = chat_model.process(inputs)
print(answer)
# Second round chat
# pass history context of multi-turn conversation
msgs.append({"role": "assistant", "content": answer})
msgs.append({"role": "user", "content": "Describe the image"})
inputs = {"image": im_64, "question": json.dumps(msgs)}
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."
- Fine-tuning support
- Local Web-UI deployment
- Code release for real-time interactive assistant
The code in this repo is released according to Apache-2.0
The usage of OmniLMMs' parameters is subject to "General Model License Agreement - Source Notes - Publicity Restrictions - Commercial License"
The parameters are fully open to acedemic research
Please contact [email protected] to obtain a written authorization for commercial uses. Free commercial use is also allowed after registration.
As LMMs, OmniLMMs generate contents by learning a large mount of multimodal corpora, but it cannot comprehend, express personal opinions or make value judgement. Anything generated by OmniLMMs does not represent the views and positions of the model developers
We will not be liable for any problems arising from the use of OmniLMM open source models, including but not limited to data security issues, risk of public opinion, or any risks and problems arising from the misdirection, misuse, dissemination or misuse of the model.
This project is developed by the following institutions: