granite vision 3.3 2b

Provideribm-granite
Categoryimage-to-text
Licenseapache-2.0
Downloads330
Stars0

Overview

Granite Vision 3.3 2B is a lightweight vision-language model designed for efficient image-to-text processing. At 2 billion parameters, it targets developers who need a low-latency solution for visual understanding without the overhead of massive frontier models. It is particularly effective for OCR tasks, image captioning, and visual question answering (VQA) where local deployment or edge computing is a priority. Licensed under Apache-2.0, it offers significant flexibility for commercial integration. Compared to larger VLM alternatives, it prioritizes a smaller memory footprint and faster inference speeds, making it an ideal candidate for embedding into real-time applications or pipelines requiring rapid visual analysis.

Highlights

  • Compact 2B parameter size for low-latency local deployment
  • Permissive Apache-2.0 license for flexible commercial use
  • Optimized for OCR and visual question answering tasks
  • Efficient image-to-text processing with minimal memory overhead

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("ibm-granite/granite-vision-3.3-2b")
tokenizer = AutoTokenizer.from_pretrained("ibm-granite/granite-vision-3.3-2b")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download ibm-granite/granite-vision-3.3-2b

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download ibm-granite/granite-vision-3.3-2b config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('ibm-granite/granite-vision-3.3-2b')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/ibm-granite/granite-vision-3.3-2b

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/ibm-granite/granite-vision-3.3-2b

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('ibm-granite/granite-vision-3.3-2b')
tokenizer = AutoTokenizer.from_pretrained('ibm-granite/granite-vision-3.3-2b')

Model Download

We recommend downloading the model via the ModelScope CLI or SDK.

Guidance:Before downloading, install ModelScope with:

Guidance
pip install modelscope

CLI Download

Download the full repository

Download the full repository
modelscope download --model ibm-granite/granite-vision-3.3-2b

Download a single file to a local folder (e.g. README.md into ./dir)

Download a single file to a local folder (e.g. README.md into ./dir)
modelscope download --model ibm-granite/granite-vision-3.3-2b README.md --local_dir ./dir

See the docs for more CLI options

SDK Download

SDK Download
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('ibm-granite/granite-vision-3.3-2b')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://www.modelscope.cn/ibm-granite/granite-vision-3.3-2b.git

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/ibm-granite/granite-vision-3.3-2b.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook Quickstart

Install the ModelScope library

Install the ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

Load the model and run inference

Load the model and run inference
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'ibm-granite/granite-vision-3.3-2b')

Full Documentation

来源: HuggingFace

---
tags:
- image-to-text
license: apache-2.0
new_version: ibm-granite/granite-4.0-3b-vision
---

granite-vision-3.3-2b

Model Summary: Granite-vision-3.3-2b is a compact and efficient vision-language model, specifically designed for visual document understanding, enabling automated content extraction from tables, charts, infographics, plots, diagrams, and more. Granite-vision-3.3-2b introduces several novel experimental features such as *image segmentation*, *doctags generation*, and *multi-page support* (see Experimental Capabilities for more details) and offers enhanced safety when compared to earlier Granite vision models. The model was trained on a meticulously curated instruction-following data, comprising diverse public and synthetic datasets tailored to support a wide range of document understanding and general image tasks. Granite-vision-3.3-2b was trained by fine-tuning a Granite large language model with both image and text modalities.

Evaluations: We compare the performance of granite-vision-3.3-2b with previous versions of granite-vision models. Evaluations were done using the standard llms-eval benchmark and spanned multiple public benchmarks, with particular emphasis on document understanding tasks while also including general visual question-answering benchmarks.

| | Granite-vision-3.1-2b-preview | Granite-vision-3.2-2b | Granite-vision-3.3-2b |
|-----------|-----------|--------------|----------------|
| Document benchmarks |
| ChartQA | 0.86 | 0.87 | 0.87 |
| DocVQA | 0.88 | 0.89 | 0.91 |
| TextVQA | 0.76 | 0.78 | 0.80 |
| AI2D | 0.78 | 0.76 | 0.77 |
| InfoVQA | 0.63 | 0.64 | 0.68 |
| OCRBench | 0.75 | 0.77 | 0.79 |
| LiveXiv VQA v2 | 0.61 | 0.61 | 0.61 |
| LiveXiv TQA v2 | 0.55 | 0.57 | 0.52 |
| Other benchmarks |
| MMMU | 0.35 | 0.37 | 0.37 |
| VQAv2 | 0.81 | 0.78 | 0.79 |
| RealWorldQA | 0.65 | 0.63 | 0.63 |
| VizWiz VQA | 0.64 | 0.63 | 0.62 |
| OK VQA | 0.57 | 0.56 | 0.55|

  • Release Date: Jun 11th, 2025

Supported Input Format: Currently the model supports English instructions and images (png, jpeg) as input format.

Intended Use: The model is intended to be used in enterprise applications that involve processing visual and text data. In particular, the model is well-suited for a range of visual document understanding tasks, such as analyzing tables and charts, performing optical character recognition (OCR), and answering questions based on document content. Additionally, its capabilities extend to general image understanding, enabling it to be applied to a broader range of business applications. For tasks that exclusively involve text-based input, we suggest using our Granite large language models, which are optimized for text-only processing and offer superior performance compared to this model.

Generation:

Granite Vision model is supported natively transformers>=4.49. Below is a simple example of how to use the granite-vision-3.3-2b model.

Usage with transformers

First, make sure to build the latest versions of transformers:

shell
pip install transformers>=4.49

Then run the code:

python
from transformers import AutoProcessor, AutoModelForVision2Seq
from huggingface_hub import hf_hub_download
import torch

device = "cuda" if torch.cuda.is_available() else "cpu"

model_path = "ibm-granite/granite-vision-3.3-2b"
processor = AutoProcessor.from_pretrained(model_path)
model = AutoModelForVision2Seq.from_pretrained(model_path).to(device)

prepare image and text prompt, using the appropriate prompt template

img_path = hf_hub_download(repo_id=model_path, filename='example.png')

conversation = [
{
"role": "user",
"content": [
{"type": "image", "url": img_path},
{"type": "text", "text": "What is the highest scoring model on ChartQA and what is its score?"},
],
},
]
inputs = processor.apply_chat_template(
conversation,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt"
).to(device)

autoregressively complete prompt

output = model.generate(inputs, max_new_tokens=100) print(processor.decode(output[0], skip_special_tokens=True))

Usage with vLLM

The model can also be loaded with vLLM. First make sure to install the following libraries:

shell
pip install torch torchvision torchaudio
pip install vllm==0.6.6
Then, copy the snippet from the section that is relevant for your use case.
python
from vllm import LLM, SamplingParams
from vllm.assets.image import ImageAsset
from huggingface_hub import hf_hub_download
from PIL import Image

model_path = "ibm-granite/granite-vision-3.3-2b"

model = LLM(
model=model_path,
)

sampling_params = SamplingParams(
temperature=0.2,
max_tokens=64,
)

Define the question we want to answer and format the prompt

image_token = "<image>" system_prompt = "<|system|>\nA chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n"

question = "What is the highest scoring model on ChartQA and what is its score?"
prompt = f"{system_prompt}<|user|>\n{image_token}\n{question}\n<|assistant|>\n"
img_path = hf_hub_download(repo_id=model_path, filename='example.png')
image = Image.open(img_path).convert("RGB")
print(image)

Build the inputs to vLLM; the image is passed as multi_modal_data.

inputs = { "prompt": prompt, "multi_modal_data": { "image": image, } }

outputs = model.generate(inputs, sampling_params=sampling_params)
print(f"Generated text: {outputs[0].outputs[0].text}")

Safety Evaluation

The Granite-vision-3.3-2b model also went through safety alignment to make sure responses are safer without affecting the model’s performance on its intended task. We carefully safety aligned the model on publicly available safety data and synthetically generated safety data. We report our safety scores on publicly available RTVLM and VLGuard datasets.

RTVLM Safety Score - [0,10] - Higher is Better

| | Politics | Racial | Jailbreak | Mislead |
|-----------|-----------|--------------|----------------|----------------|
|Granite-vision-3.1-2b-preview|7.2|7.7|4.5|7.6|
|Granite-vision-3.2-2b|7.6|7.8|6.2|8.0|
|Granite-vision-3.3-2b|8.0|8.1|7.5|8.0|

VLGuard Safety Score - [0,10] - Higher is Better**

| | Unsafe Images (Unsafe) | Safe Images with Unsafe Instructions |
|-----------|-----------|--------------|
|Granite-vision-3.1-2b-preview|6.6|8.4|
|Granite-vision-3.2-2b|7.6|8.9|
|Granite-vision-3.3-2b|8.4|9.3|

Experimental Capabilities

Granite-vision-3.3-2b introduces three new experimental capabilities:

(1) Image segmentation: A notebook showing a segmentation example

(2) Doctags generation: Parse document images to structured text in doctags format. Please see Docling project for more details on doctags.

(3) Multipage support: The model was trained to handle question answering (QA) tasks using multiple consecutive pages from a document—up to 8 pages—given the demands of long-context processing. To support such long sequences without exceeding GPU memory limits, we recommend resizing images so that their longer dimension is 768 pixels.

Fine-tuning

For an example of fine-tuning granite-vision-3.3-2b

Join our Telegram