/ Модель

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

Архитектура
clip · dense
Опубликована
17 апр 2023

clip4clip-webvid150k

Генерация видеоТекст → видео5 профессий

CLIP4Clip на базе CLIP ViT-B/32 сопоставляет текстовые запросы с видеоклипами для поиска видео в больших коллекциях.

213скачиваний за 30 дней47лайковвеса обновлены27 окт 2024

Бенчмарки

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

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

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

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

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

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

Searchium обучила эту модель CLIP4Clip на первых 150 000 парах видео и текстовых описаний из WebVid. Она основана на CLIP ViT-B/32 и реализует подход из работы «CLIP4Clip: An Empirical Study of CLIP for End to End Video Clip Retrieval».

Модель предназначена для поиска видео по текстовому запросу в больших коллекциях: она сопоставляет текст и видеоклипы, чтобы находить наиболее релевантные результаты. Для подготовки эмбеддингов видео README указывает на отдельную процедуру предобработки и ноутбук; веса доступны в форматах PyTorch и safetensors.

В описанной авторами оценке на отложенных примерах WebVid модель показала Recall@1 50,74, Recall@5 77,30 и Recall@10 85,05. Эти результаты относятся к конкретному набору данных и протоколу оценки и не гарантируют аналогичного качества на других коллекциях. Лицензия в предоставленных данных не указана.

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

  • поиск видео по текстовому запросу
  • ранжирование видеоклипов по соответствию описанию
  • построение текстового поиска по большой видеотеке

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

Model Card for CLIP4Clip/WebVid-150k

Model Details

A CLIP4Clip video-text retrieval model trained on a subset of the WebVid dataset. The model and training method are described in the paper "Clip4Clip: An Empirical Study of CLIP for End to End Video Clip Retrieval" by Lou et el, and implemented in the accompanying GitHub repository.

The training process utilized the WebVid Dataset, a comprehensive collection of short videos with corresponding textual descriptions sourced from the web. For training purposes, a subset consisting of the first 150,000 video-text pairs from the dataset were used.

This HF model is based on the clip-vit-base-patch32 architecture, with weights trained by Daphna Idelson at Searchium.

How to use

Extracting Text Embeddings:

import numpy as np
import torch
from transformers import CLIPTokenizer, CLIPTextModelWithProjection


search_sentence = "a basketball player performing a slam dunk"

model = CLIPTextModelWithProjection.from_pretrained("Searchium-ai/clip4clip-webvid150k")
tokenizer = CLIPTokenizer.from_pretrained("Searchium-ai/clip4clip-webvid150k")

inputs = tokenizer(text=search_sentence , return_tensors="pt")
outputs = model(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"])

# Normalize embeddings for retrieval:
final_output = outputs[0] / outputs[0].norm(dim=-1, keepdim=True)
final_output = final_output.cpu().detach().numpy()
print("final output: ", final_output)

Extracting Video Embeddings:

An additional notebook "GSI_VideoRetrieval_VideoEmbedding.ipynb", provides instructions for extracting video embeddings and includes the necessary tools for preprocessing videos.

Model Intended Use

This model is intended for use in large scale video-text retrieval applications.

To illustrate its functionality, refer to the accompanying Video Search Space which provides a search demonstration on a vast collection of approximately 1.5 million videos. This interactive demo showcases the model's capability to effectively retrieve videos based on text queries, highlighting its potential for handling substantial video datasets.

Motivation

As per the original authors, the main motivation behind this work is to leverage the power of the CLIP image-language pre-training model and apply it to learning visual-temporal concepts from videos, thereby improving video-based searches.

By using the WebVid dataset, the model's capabilities were enhanced even beyond those described in the paper, thanks to the large-scale and diverse nature of the dataset empowering the model's performance.

Evaluations

To evaluate the model's performance we used the last last 10,000 video clips and their accompanying text from the Webvid dataset. We evaluate R1, R5, R10, MedianR, and MeanR on:

  1. Zero-shot pretrained clip-vit-base-patch32 model
  2. CLIP4Clip based weights trained on the dataset MSR-VTT, consisting of 10,000 video-text pairs
  3. CLIP4Clip based weights trained on a 150K subset of the dataset Webvid-2M
  4. CLIP4Clip based weights trained on a 150K subset of the dataset Webvid-2M - binarized and further finetuned on 100 top searches - for search acceleration and efficiency [1].
ModelR1 ↑R5 ↑R10 ↑MedianR ↓MeanR ↓
Zero-shot clip weights37.1662.1071.163.042.2128
CLIP4Clip weights trained on msr-vtt38.3862.8972.013.039.3023
CLIP4Clip trained on 150k Webvid50.7477.3085.051.014.9535
Binarized CLIP4Clip trained on 150k Webvid with rerank10050.5676.3983.511.043.2964

For an elaborate description of the evaluation refer to the notebook GSI_VideoRetrieval-Evaluation.

[1] For overall search acceleration capabilities, in order to boost your search application, please refer to Searchium.ai

Acknowledgements

Acknowledging Diana Mazenko of Searchium for adapting and loading the model to Hugging Face, and for creating a Hugging Face SPACE for a large-scale video-search demo.

Acknowledgments also to Lou et el for their comprehensive work on CLIP4Clip and openly available code.

Citations

CLIP4Clip paper

@Article{Luo2021CLIP4Clip,
  author  = {Huaishao Luo and Lei Ji and Ming Zhong and Yang Chen and Wen Lei and Nan Duan and Tianrui Li},
  title   = {{CLIP4Clip}: An Empirical Study of CLIP for End to End Video Clip Retrieval},
  journal = {arXiv preprint arXiv:2104.08860},
  year    = {2021},
}

OpenAI CLIP paper

@inproceedings{Radford2021LearningTV,
  title={Learning Transferable Visual Models From Natural Language Supervision},
  author={Alec Radford and Jong Wook Kim and Chris Hallacy and A. Ramesh and Gabriel Goh and Sandhini Agarwal and Girish Sastry and Amanda Askell and Pamela Mishkin and Jack Clark and Gretchen Krueger and Ilya Sutskever},
  booktitle={ICML},
  year={2021}
}

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

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

GPU в ailist

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

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

Генеративная модель выложена не в формате diffusers.

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

0 моделей