Views
No views yet

| Architecture | ViT | LLM | Adapter | Token Merge | Resolution |
|---|---|---|---|---|---|
| 🤗SAIL-VL-1.5-2B | 🤗SAILViT-Huge | 🤗Qwen2.5-1.5B | 2-layer MLP | 2x2 | 448x448xN |
| 🤗SAIL-VL-1.5-8B | 🤗InternViT-300M | 🤗Qwen2.5-7B | 2-layer MLP | 2x2 | 448x448xN |
| 🤗SAIL-VL-2B | 🤗InternViT-300M | 🤗Qwen2.5-1.5B | 2-layer MLP | 2x2 | 448x448xN |
| 🤗SAIL-VL-8B | 🤗InternViT-300M | 🤗Qwen2.5-7B | 2-layer MLP | 2x2 | 448x448xN |

| Benchmark | SAIL-VL-8B | Qwen2-VL-8B | InternVL2.5-MPO-8B | DeepSeekVL-2-Small |
|---|---|---|---|---|
| Overall Performance | 74.5 | 73.0 | 74.3 | 72.7 |
| General VQA | 68.3 | 68.5 | 71.2 | 66.8 |
| OCR VQA | 79.8 | 79.6 | 76.3 | 79.0 |
| Math&Knowledge | 83.3 | 71.0 | 83.2 | 79.0 |
| Hallucination | 68.7 | 67.5 | 69.7 | 65.3 |
| General VQA | ||||
| MMStar | 64.2 | 58.3 | 65.3 | 57.7 |
| MMBench_DEV | 79.5 | 79.5 | 83.3 | 78.1 |
| MMMU_VAL | 48.2 | 50.9 | 52.8 | 47.6 |
| MME | 2244 | 2321 | 2321 | 2149 |
| SEEDBench_IMG | 75.5 | 75.3 | 76.9 | 76.8 |
| RealWorldQA | 71.9 | 69.7 | 70.2 | 70.2 |
| MMVET | 58.3 | 62.6 | 66.8 | 60.3 |
| OCR VQA | ||||
| AI2D_TEST | 83.7 | 82.9 | 84.1 | 82.0 |
| DocVQA_Val | 92.2 | 93.7 | 92.1 | 92.3 |
| InfoVQA_Val | 75.2 | 75.9 | 76.2 | 72.5 |
| ChartQA_Test | 84.6 | 81.6 | 77.6 | 84.6 |
| TextVQA_Val | 77.7 | 83.8 | 79.2 | 83.3 |
| OCRVQA_Test | 61.4 | 56.2 | 36.7 | 54.5 |
| OCRBench | 835 | 833 | 880 | 834 |
| Math&Knowledge | ||||
| MathVistaMini | 68.4 | 57.3 | 68.5 | 61.8 |
| ScienceQA_Val | 98.2 | 84.6 | 97.9 | 96.2 |
| Hallucination | ||||
| HallucinationBench | 52.2 | 48.5 | 50.3 | 41.2 |
| POPE | 85.2 | 86.5 | 89.1 | 89.4 |
| Image | Question | Answer |
|---|---|---|
![]() | Please describe the image shortly. | The image prominently features the Golden Gate Bridge, an iconic suspension bridge in San Francisco, California. It spans across a body of water, presumably the San Francisco Bay. The photograph captures the bridge in a clear day with minimal cloud cover. Visible in the image's lower part is the adjacent cityscape and landscape, including parts of a building on the left side which looks like a low-lying brick structure, likely part of nearby infrastructure or a historical site in San Francisco. |
![]() | Why is this meme funny? | This meme is funny because it cleverly plays on the contrast between the human's focused strategy and the dog's random play. The image juxtaposes a child intensely trying to predict the dog's next move with the dog itself, which shows a checkers board and the caption "Me playing it on random." It humorously suggests that the dog, despite its seemingly haphazard approach, is the true master of the game. This creates a comical situation where a human child is perplexed by the dog's unpredictable moves, while the dog seems completely at ease with its own casual, random play style. |
![]() | Do you recognize this place ? | Yes, I recognize the place. This is the Temple of Heaven, located in Beijing, China. It's a famous historical site and architectural gem known for its distinctive appearance and cultural significance. The Temple of Heaven is renowned for its circular shape and beautiful architecture, combining elements of East Asian design with unique features that set it apart from other Chinese temple structures. It was originally built in the early 15th century during the Ming Dynasty and has since become an iconic representation of Chinese architecture and imperial history. |
![]() | Help me write a travel plan for this place. | Travel Plan for Temple of Heaven:\n 1. Morning: Depart early to avoid crowds.\n 2. Arrive at Temple of Heaven, explore the main structure, learn about its significance.\n 3. Take a guided tour of the surrounding gardens and historical sites.\n 4. Enjoy an authentic lunch in the vicinity. \n 5. Continue exploration, visit the Prayer Hall. \n 6. Visit during sunset for a serene experience. \n 7. End with evening meals showcasing local cuisine. \n 8. Take time to reflect on the experience as you leave. |
![]() | Introduce me this painting. | This iconic artwork is "Starry Night," painted by Vincent van Gogh in 1889. The canvas captures a swirling night sky filled with vibrant blue and yellow hues, giving it a mesmerizing, dream-like quality. Van Gogh's bold, expressive brushstrokes bring the night scene to life, creating a sense of movement and energy that captivates viewers. Below the ethereal sky, a small village and church anchor the composition, adding a touch of human presence to the vast, celestial expanse. This masterpiece exemplifies Van Gogh's unique style, showcasing his deep emotional connection to nature and the universe. |
pip3 install einops transformers timm1import numpy as np
2import torch
3import torchvision.transforms as T
4from PIL import Image
5from torchvision.transforms.functional import InterpolationMode
6from transformers import AutoModel, AutoTokenizer
7
8IMAGENET_MEAN = (0.485, 0.456, 0.406)
9IMAGENET_STD = (0.229, 0.224, 0.225)
10
11def build_transform(input_size):
12 MEAN, STD = IMAGENET_MEAN, IMAGENET_STD
13 transform = T.Compose([
14 T.Lambda(lambda img: img.convert('RGB') if img.mode != 'RGB' else img),
15 T.Resize((input_size, input_size), interpolation=InterpolationMode.BICUBIC),
16 T.ToTensor(),
17 T.Normalize(mean=MEAN, std=STD)
18 ])
19 return transform
20
21def find_closest_aspect_ratio(aspect_ratio, target_ratios, width, height, image_size):
22 best_ratio_diff = float('inf')
23 best_ratio = (1, 1)
24 area = width * height
25 for ratio in target_ratios:
26 target_aspect_ratio = ratio[0] / ratio[1]
27 ratio_diff = abs(aspect_ratio - target_aspect_ratio)
28 if ratio_diff < best_ratio_diff:
29 best_ratio_diff = ratio_diff
30 best_ratio = ratio
31 elif ratio_diff == best_ratio_diff:
32 if area > 0.5 * image_size * image_size * ratio[0] * ratio[1]:
33 best_ratio = ratio
34 return best_ratio
35
36def dynamic_preprocess(image, min_num=1, max_num=10, image_size=448, use_thumbnail=False):
37 orig_width, orig_height = image.size
38 aspect_ratio = orig_width / orig_height
39
40 # calculate the existing image aspect ratio
41 target_ratios = set(
42 (i, j) for n in range(min_num, max_num + 1) for i in range(1, n + 1) for j in range(1, n + 1) if
43 i * j <= max_num and i * j >= min_num)
44 target_ratios = sorted(target_ratios, key=lambda x: x[0] * x[1])
45
46 # find the closest aspect ratio to the target
47 target_aspect_ratio = find_closest_aspect_ratio(
48 aspect_ratio, target_ratios, orig_width, orig_height, image_size)
49
50 # calculate the target width and height
51 target_width = image_size * target_aspect_ratio[0]
52 target_height = image_size * target_aspect_ratio[1]
53 blocks = target_aspect_ratio[0] * target_aspect_ratio[1]
54
55 # resize the image
56 resized_img = image.resize((target_width, target_height))
57 processed_images = []
58 for i in range(blocks):
59 box = (
60 (i % (target_width // image_size)) * image_size,
61 (i // (target_width // image_size)) * image_size,
62 ((i % (target_width // image_size)) + 1) * image_size,
63 ((i // (target_width // image_size)) + 1) * image_size
64 )
65 # split the image
66 split_img = resized_img.crop(box)
67 processed_images.append(split_img)
68 assert len(processed_images) == blocks
69 if use_thumbnail and len(processed_images) != 1:
70 thumbnail_img = image.resize((image_size, image_size))
71 processed_images.append(thumbnail_img)
72 return processed_images
73
74def load_image(image_file, input_size=448, max_num=10):
75 image = Image.open(image_file).convert('RGB')
76 transform = build_transform(input_size=input_size)
77 images = dynamic_preprocess(image, image_size=input_size, use_thumbnail=True, max_num=max_num)
78 pixel_values = [transform(image) for image in images]
79 pixel_values = torch.stack(pixel_values)
80 return pixel_values
81
82path = "BytedanceDouyinContent/SAIL-VL-8B"
83model = AutoModel.from_pretrained(
84 path,
85 torch_dtype=torch.bfloat16,
86 trust_remote_code=True).eval().cuda()
87tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True, use_fast=False)
88
89# set the max number of tiles in `max_num`
90pixel_values = load_image('./test.png', max_num=10).to(torch.bfloat16).cuda()
91generation_config = dict(max_new_tokens=1024, do_sample=True)
92
93# pure-text conversation
94question = 'Hello, who are you?'
95response, history = model.chat(tokenizer, None, question, generation_config, history=None, return_history=True)
96print(f'User: {question} Assistant: {response}')
97
98question = 'Can you tell me a story?'
99response, history = model.chat(tokenizer, None, question, generation_config, history=history, return_history=True)
100print(f'User: {question} Assistant: {response}')
101
102# single-image single-round conversation
103question = '<image> Please describe the image shortly.'
104response = model.chat(tokenizer, pixel_values, question, generation_config)
105print(f'User: {question} Assistant: {response}')
106
107# single-image multi-round conversation
108question = '<image> Please describe the image in detail.'
109response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=None, return_history=True)
110print(f'User: {question} Assistant: {response}')
111
112question = 'Please write a poem according to the image.'
113response, history = model.chat(tokenizer, pixel_values, question, generation_config, history=history, return_history=True)
114print(f'User: {question} Assistant: {response}')@article{dong2025scalable,
title={Scalable vision language model training via high quality data curation},
author={Dong, Hongyuan and Kang, Zijian and Yin, Weijie and Liang, Xiao and Feng, Chao and Ran, Jiao},
journal={arXiv preprint arXiv:2501.05952},
year={2025}
}{Hongyuan Dong, Zijian Kang, Weijie Yin}, Xiao Liang, Chao Feng, Jiao Ran
{*} Equal Contributions.Zirui Guo, Yan Qiu, Yaling Mou, Ming JiangHuiyu Yu, Lin Dong, Yong Zhang