Video-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen2_5_vl
image-text-to-text
video-understanding
multimodal
SWIM
Qwen2.5-VL
fine-grained-understanding
Eval Results (legacy)
text-generation-inference
Instructions to use BBBBCHAN/SWIM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BBBBCHAN/SWIM-7B with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("BBBBCHAN/SWIM-7B") model = AutoModelForImageTextToText.from_pretrained("BBBBCHAN/SWIM-7B") - Notebooks
- Google Colab
- Kaggle
SWIM-7B
Paper | GitHub | NL-Refer Dataset
This repository contains the baseline model for See What I Mean: Aligning Vision and Language Representations for Video Fine-grained Object Understanding.
Model Summary
This repository contains the baseline model SWIM-7B. This model is fine-tuned from Qwen2.5-VL model with SIGLIP vision encoder and Qwen2.5-7B-Instruct large language model.
SWIM shares a same architecture with Qwen2.5-VL, You can directly replace "Qwen/Qwen2.5-VL-7B-Instruct" to "BBBBCHAN/SWIM-7B" to get fine-grained object understanding with nature language.
Quick Start
Here we provide a quick run script for SWIM-7B adopted from Qwen2.5-VL.
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info
# default: Load the model on the available device(s)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
"BBBBCHAN/SWIM-7B", torch_dtype="auto", device_map="auto"
)
# We recommend enabling flash_attention_2 for better acceleration and memory saving, especially in multi-image and video scenarios.
# model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
# "BBBBCHAN/SWIM-7B",
# torch_dtype=torch.bfloat16,
# attn_implementation="flash_attention_2",
# device_map="auto",
# )
# default processer
processor = AutoProcessor.from_pretrained("BBBBCHAN/SWIM-7B")
# The default range for the number of visual tokens per image in the model is 4-16384.
# You can set min_pixels and max_pixels according to your needs, such as a token range of 256-1280, to balance performance and cost.
# min_pixels = 256*28*28
# max_pixels = 1280*28*28
# processor = AutoProcessor.from_pretrained("BBBBCHAN/SWIM-7B", min_pixels=min_pixels, max_pixels=max_pixels)
# Messages containing a local video path and a text query
messages = [
{
"role": "user",
"content": [
{
"type": "video",
"video": "file:///path/to/video1.mp4",
"max_pixels": 360 * 420,
"fps": 1.0,
},
{"type": "text", "text": "Describe this video."},
],
}
]
#In Qwen 2.5 VL, frame rate information is also input into the model to align with absolute time.
# Preparation for inference
text = processor.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs, video_kwargs = process_vision_info(messages, return_video_kwargs=True)
inputs = processor(
text=[text],
images=image_inputs,
videos=video_inputs,
fps=fps,
padding=True,
return_tensors="pt",
**video_kwargs,
)
inputs = inputs.to("cuda")
# Inference
generated_ids = model.generate(**inputs, max_new_tokens=128)
generated_ids_trimmed = [
out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)
print(output_text)
Citation
If you find our repo useful for your research, please consider citing our paper:
@inproceedings{sun2026swim,
title = {See What I Mean: Aligning Vision and Language Representations
for Video Fine-grained Object Understanding},
author = {Sun, Boyuan and Yin, Bowen and Li, Yuanming and Wei, Xihan and Hou, Qibin},
booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2026}
}
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support
Model tree for BBBBCHAN/SWIM-7B
Datasets used to train BBBBCHAN/SWIM-7B
Viewer • Updated • 1.63M • 29.4k • 194
DAMO-NLP-SG/VideoRefer-700K
Updated • 1.51k • 7
BBBBCHAN/NL-Refer
Preview • Updated • 1
Paper for BBBBCHAN/SWIM-7B
Evaluation results
- accuracy on VideoRefer-Qself-reported78.300
- accuracy on VideoRefer-Dself-reported3.780
- accuracy on MVBenchself-reported62.100
- accuracy on VideoMMEself-reported55.900
- accuracy on ActivityNetQAself-reported55.600