/ Модель

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

Размер весов
16,5 ГБ
Лицензия
Apache 2.0
Архитектура
idefics2 · dense
Библиотека
transformers
Опубликована
19 июн 2024

VideoScore

Классификация текстаТекст → label5 профессий

VideoScore оценивает качество видео и соответствие видеоряда текстовому описанию по нескольким аспектам.

63скачиваний за 30 дней8лайковвеса обновлены8 янв 2025

Бенчмарки

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

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

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

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

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

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

VideoScore — модель оценки качества видео от TIGER-Lab, созданная на основе Mantis-8B-Idefics2 и обученная на наборе VideoFeedback с человеческими оценками по нескольким аспектам. Это регрессионная версия: она оценивает видео и текстовое описание, сопоставляя их и выдавая оценки качества и соответствия текста содержанию видео. Модель предназначена для оценки видео, в том числе роликов, созданных по текстовому запросу, и для сравнения результатов с человеческими предпочтениями.

В README заявлена корреляция Спирмена 75,7 с человеческими оценками на VideoFeedback-test; также модель оценивалась на EvalCrafter, GenAI-Bench и VBench. Вариант из этой карточки построен на Idefics2; улучшенная версия VideoScore-v1.1 поддерживает обработку до 48 кадров, однако README не приписывает эту характеристику однозначно данной версии. Для запуска описана библиотека Transformers. Модель распространяется по лицензии Apache-2.0.

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

  • оценка качества сгенерированного видео
  • оценка соответствия видео текстовому запросу
  • сравнение качества вариантов видеоролика
  • прогнозирование человеческих оценок видео
  • ранжирование видео по предпочтениям зрителей

Ограничения

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

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

📃Paper | 🌐Website | 💻Github | 🛢️Datasets | 🤗Model (VideoScore) | 🤗Model (VideoScore-anno-only) | 🤗Model (VideoScore-v1.1)| 🤗Model (VideoScore-Qwen2-VL) | 🤗Demo | 📉Wandb (VideoScore)

VideoScore

Introduction

  • 🤯🤯Try on the new version VideoScore-v1.1, which is a variant from VideoScore with better performance in "text-to-video alignment" subscore and the support for 48 frames in inference now!

  • VideoScore series is a video quality evaluation model series, taking Mantis-8B-Idefics2 or Qwen2-VL as base model and trained on VideoFeedback, a large video evaluation dataset with multi-aspect human scores.

  • VideoScore can reach 75+ Spearman correlation with humans on VideoFeedback-test, surpassing all the MLLM-prompting methods and feature-based metrics. VideoScore also beat the best baselines on other three benchmarks EvalCrafter, GenAI-Bench and VBench, showing high alignment with human evaluations. For the data details of four benchmarks, please refer to VideoScore-Bench.

  • This is the regression version of VideoScore

Evaluation Results

We test our video evaluation model series VideoScore on VideoFeedback-test, EvalCrafter, GenAI-Bench and VBench. For the first two benchmarks, we take Spearman corrleation between model's output and human ratings averaged among all the evaluation aspects as indicator. For GenAI-Bench and VBench, which include human preference data among two or more videos, we employ the model's output to predict preferences and use pairwise accuracy as the performance indicator.

  • For the benchmark VideoFeedback-test, We use VideoScore trained on the entire VideoFeedback dataset.

  • For other three benchmarks GenAI-Bench, VBench and EvalCrafter, We use VideoScore-anno-only trained on VideoFeedback dataset excluding the real videos.

The evaluation results are shown below:

metricFinal Avg ScoreVideoFeedback-testEvalCrafterGenAI-BenchVBench
VideoScore (reg)69.675.751.178.573.0
VideoScore (gen)55.677.127.659.058.7
Gemini-1.5-Pro39.722.122.960.952.9
Gemini-1.5-Flash39.420.817.367.152.3
GPT-4o38.923.128.752.051.7
CLIP-sim31.78.936.234.247.4
DINO-sim30.37.532.138.543.3
SSIM-sim29.513.426.934.143.5
CLIP-Score28.6-7.221.745.054.9
LLaVA-1.5-7B27.18.510.549.939.4
LLaVA-1.6-7B23.3-3.113.244.538.7
X-CLIP-Score23.2-1.913.341.440.1
PIQE19.6-10.1-1.234.5 55.1
BRISQUE19.0-20.33.938.553.7
Idefics218.36.50.334.631.7
MSE-dyn10.6-5.5-17.028.436.5
SSIM-dyn9.2-12.9-26.431.444.5

The best in VideoScore series is in bold and the best in baselines is underlined.

Usage

Installation

pip install git+https://github.com/TIGER-AI-Lab/VideoScore.git
# or
# pip install mantis-vl

Inference

cd VideoScore/examples
import av
import numpy as np
from typing import List
from PIL import Image
import torch
from transformers import AutoProcessor
from mantis.models.idefics2 import Idefics2ForSequenceClassification

def _read_video_pyav(
    frame_paths:List[str], 
    max_frames:int,
):
    frames = []
    container.seek(0)
    start_index = indices[0]
    end_index = indices[-1]
    for i, frame in enumerate(container.decode(video=0)):
        if i > end_index:
            break
        if i >= start_index and i in indices:
            frames.append(frame)
    return np.stack([x.to_ndarray(format="rgb24") for x in frames])

MAX_NUM_FRAMES=16
ROUND_DIGIT=3
REGRESSION_QUERY_PROMPT = """
Suppose you are an expert in judging and evaluating the quality of AI-generated videos,
please watch the following frames of a given video and see the text prompt for generating the video,
then give scores from 5 different dimensions:
(1) visual quality: the quality of the video in terms of clearness, resolution, brightness, and color
(2) temporal consistency, both the consistency of objects or humans and the smoothness of motion or movements
(3) dynamic degree, the degree of dynamic changes
(4) text-to-video alignment, the alignment between the text prompt and the video content
(5) factual consistency, the consistency of the video content with the common-sense and factual knowledge

for each dimension, output a float number from 1.0 to 4.0,
the higher the number is, the better the video performs in that sub-score, 
the lowest 1.0 means Bad, the highest 4.0 means Perfect/Real (the video is like a real video)
Here is an output example:
visual quality: 3.2
temporal consistency: 2.7
dynamic degree: 4.0
text-to-video alignment: 2.3
factual consistency: 1.8

For this video, the text prompt is "{text_prompt}",
all the frames of video are as follows:
"""

model_name="TIGER-Lab/VideoScore"
video_path="video1.mp4"
video_prompt="Near the Elephant Gate village, they approach the haunted house at night. Rajiv feels anxious, but Bhavesh encourages him. As they reach the house, a mysterious sound in the air adds to the suspense."

processor = AutoProcessor.from_pretrained(model_name,torch_dtype=torch.bfloat16)
model = Idefics2ForSequenceClassification.from_pretrained(model_name,torch_dtype=torch.bfloat16).eval()
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

# sample uniformly 8 frames from the video
container = av.open(video_path)
total_frames = container.streams.video[0].frames
if total_frames > MAX_NUM_FRAMES:
    indices = np.arange(0, total_frames, total_frames / MAX_NUM_FRAMES).astype(int)
else:
    indices = np.arange(total_frames)

frames = [Image.fromarray(x) for x in _read_video_pyav(container, indices)]
eval_prompt = REGRESSION_QUERY_PROMPT.format(text_prompt=video_prompt)
num_image_token = eval_prompt.count("<image>")
if num_image_token < len(frames):
    eval_prompt += "<image> " * (len(frames) - num_image_token)

flatten_images = []
for x in [frames]:
    if isinstance(x, list):
        flatten_images.extend(x)
    else:
        flatten_images.append(x)
flatten_images = [Image.open(x) if isinstance(x, str) else x for x in flatten_images]
inputs = processor(text=eval_prompt, images=flatten_images, return_tensors="pt")
inputs = {k: v.to(model.device) for k, v in inputs.items()}

with torch.no_grad():
    outputs = model(**inputs)

logits = outputs.logits
num_aspects = logits.shape[-1]

aspect_scores = []
for i in range(num_aspects):
    aspect_scores.append(round(logits[0, i].item(),ROUND_DIGIT))
print(aspect_scores)

"""
model output on visual quality, temporal consistency, dynamic degree,
text-to-video alignment, factual consistency, respectively

[2.297, 2.469, 2.906, 2.766, 2.516]
"""

Training

see VideoScore/training for details

Evaluation

see VideoScore/benchmark for details

Citation

@article{he2024videoscore,
  title = {VideoScore: Building Automatic Metrics to Simulate Fine-grained Human Feedback for Video Generation},
  author = {He, Xuan and Jiang, Dongfu and Zhang, Ge and Ku, Max and Soni, Achint and Siu, Sherman and Chen, Haonan and Chandra, Abhranil and Jiang, Ziyan and Arulraj, Aaran and Wang, Kai and Do, Quy Duc and Ni, Yuansheng and Lyu, Bohan and Narsupalli, Yaswanth and Fan, Rongqi and Lyu, Zhiheng and Lin, Yuchen and Chen, Wenhu},
  journal = {ArXiv},
  year = {2024},
  volume={abs/2406.15252},
  url = {https://arxiv.org/abs/2406.15252},
}

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

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

GPU в ailist

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

Нельзя запустить

Для архитектуры idefics2 нет загрузчика под задачу text-classification.

Класс архитектуры
Idefics2ForSequenceClassification
Ревизия весов
45a2abb

0 моделей