/ Модель

Характеристики

Контекст
128 000 токенов
Параметры
7,1 млрд
Размер весов
16,6 ГБ
Лицензия
Своя лицензия
Архитектура
qwen2_5_vl · dense
Базовая модель
Qwen2.5-VL-7B-Instruct
Библиотека
transformers
Опубликована
28 апр 2025

qwen2.5-vl-7b-cam-motion

Компьютерное зрениеВидео, текст → текст4 профессии

Дообученная Qwen2.5-VL модель для классификации движений камеры в видео и поиска роликов по текстовым описаниям.

246скачиваний за 30 дней18лайковвеса обновлены19 сен 2025

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Изображение → текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

chancharikm/qwen2.5-vl-7b-cam-motion — дообученная модель Qwen/Qwen2.5-VL-7B-Instruct, созданная для распознавания движений камеры в видео и поиска видео по текстовым описаниям таких движений. Разработчики обучили её на общедоступном наборе данных CameraBench; карточка называет модель предварительной версией и заявляет лучшие на момент публикации результаты в классификации движений камеры и поиске видео по тексту с оценкой VQAScore.

Модель основана на плотной мультимодальной архитектуре Qwen2.5-VL и содержит 7,1 млрд параметров. Она принимает видео и текстовые запросы, а также может генерировать текстовые ответы. Для оценки соответствия видео описанию в README рекомендован подход VQAScore через пакет t2v_metrics. Контекст модели — до 128 000 токенов.

Модель подходит для классификации движений камеры в роликах и оценки соответствия видео текстовым подписям при поиске и ранжировании. Указана лицензия other; точные условия следует проверять в карточке репозитория и у базовой модели. Это предварительная версия, поэтому заявленные результаты могут не переноситься на другие наборы данных и сценарии.

Сценарии применения

  • Определение движения камеры в видеоролике
  • Поиск видео по описанию движения камеры
  • Оценка соответствия видео текстовой подписи
  • Сопоставление роликов с текстовыми запросами для видеокаталога

Ограничения

Это предварительная версия, а заявление о лучших результатах относится к оценкам разработчиков и не гарантирует качество на других наборах данных. Точные условия лицензии с пометкой other следует сверить в репозитории.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Model description

This model is a fine-tuned version of Qwen/Qwen2.5-VL-7B-Instruct on the current most, high-quality camera motion dataset that is publically available. This preview model is the current SOTA for classifying camera motion or being used for video-text retrieval with camera motion captions using VQAScore. Find more information about our work on our Github page for CameraBench. More updates to the benchmark and models will come in the future. Stay tuned!

Intended uses & limitations

The usage is identical to a Qwen2.5-VL model. Our model is primarily useful for camera motion classification in videos as well as video-text retrieval (current SOTA in both tasks).

A quick demo is shown below:

We have two ways of using our model for this application. The first is the recommended t2v_metrics approach which we recommend. The latter is a back-up approach directly using Qwen2.5-VL's inference demo.

  1. t2v_metrics Approach (recommended)
# Install the package using: pip install git+https://github.com/chancharikmitra/t2v_metrics.git

import t2v_metrics

### For a single (video, text) pair:
qwen_score = t2v_metrics.VQAScore(model='qwen2.5-vl-7b', checkpoint='chancharikm/qwen2.5-vl-7b-cam-motion') 
video = "videos/baby.mp4" # a video path in string format
text = "a baby crying"
# Calculate probability of "Yes" response
score = qwen_score(images=[video], texts=[text])

For more details, please refer to the t2v_metrics fork.

  1. Qwen2.5-VL Inference Code Approach
# Import necessary libraries
from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info
import torch

# Load the model
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    "chancharikm/qwen2.5-vl-7b-cam-motion", torch_dtype="auto", device_map="auto"
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")

# Prepare input data
video_path = "file:///path/to/video1.mp4"
text_description = "the camera tilting upward"
question = f"Does this video show \"{text_description}\"?"

# Format the input for the model
messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "video",
                "video": video_path,
                "fps": 8.0,  # Recommended FPS for optimal inference
            },
            {"type": "text", "text": question},
        ],
    }
]

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,
    padding=True,
    return_tensors="pt",
    **video_kwargs
)
inputs = inputs.to("cuda")

# Generate with score output
with torch.inference_mode():
    outputs = model.generate(
        **inputs,
        max_new_tokens=1,
        do_sample=False,  # Use greedy decoding to get reliable logprobs
        output_scores=True,
        return_dict_in_generate=True
    )

# Calculate probability of "Yes" response
scores = outputs.scores[0]
probs = torch.nn.functional.softmax(scores, dim=-1)
yes_token_id = processor.tokenizer.encode("Yes")[0]
score = probs[0, yes_token_id].item()

print(f"Video: {video_path}")
print(f"Description: '{text_description}'")
print(f"Score: {score:.4f}")

We have two ways of using our model for this application. The first is the recommended t2v_metrics approach which we recommend. The latter is a back-up approach directly using Qwen2.5-VL's inference demo.

  1. t2v_metrics Approach (recommended)
# Install the package using: pip install git+https://github.com/chancharikmitra/t2v_metrics.git

import t2v_metrics

### For a single (video, text) pair:
qwen_score = t2v_metrics.VQAScore(model='qwen2.5-vl-7b', checkpoint='chancharikm/qwen2.5-vl-7b-cam-motion') 
video = "videos/baby.mp4" # a video path in string format
text =  "Please describe this image: "
# Calculate probability of "Yes" response
score = qwen_score.model.generate(images=[video], texts=[text])

For more details, please refer to the t2v_metrics fork.

  1. Qwen2.5-VL Inference Code Approach
# The model is trained on 8.0 FPS which we recommend for optimal inference

from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info

# default: Load the model on the available device(s)
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    "chancharikm/qwen2.5-vl-7b-cam-motion", 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(
#     "chancharikm/qwen2.5-vl-7b-cam-motion",
#     torch_dtype=torch.bfloat16,
#     attn_implementation="flash_attention_2",
#     device_map="auto",
# )

# default processor
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "video",
                "video": "file:///path/to/video1.mp4",
                "fps": 8.0,
            },
            {"type": "text", "text": "Describe the camera motion in this video."},
        ],
    }
]

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)

Training and evaluation data

Training and evaluation data can be found in our repo.

Training procedure

We use the LLaMA-Factory codebase to finetune our model. Please use the above data and the hyperparameters below to replicate our work if desired.

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 1e-05
  • train_batch_size: 4
  • eval_batch_size: 1
  • seed: 42
  • distributed_type: multi-GPU
  • num_devices: 8
  • gradient_accumulation_steps: 8
  • total_train_batch_size: 256
  • total_eval_batch_size: 8
  • optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
  • lr_scheduler_type: cosine
  • lr_scheduler_warmup_ratio: 0.1
  • num_epochs: 10.0

✏️ Citation

If you find this repository useful for your research, please use the following.

@article{lin2025camerabench,
  title={Towards Understanding Camera Motions in Any Video},
  author={Lin, Zhiqiu and Cen, Siyuan and Jiang, Daniel and Karhade, Jay and Wang, Hewei and Mitra, Chancharik and Ling, Tiffany and Huang, Yuhan and Liu, Sifan and Chen, Mingyu and Zawar, Rushikesh and Bai, Xue and Du, Yilun and Gan, Chuang and Ramanan, Deva},
  journal={arXiv preprint arXiv:2504.15376},
  year={2025},
}

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen2_5_VLForConditionalGeneration
Ревизия весов
b37e7f9

0 моделей