google-deepmind/videoprism

Official repository for "VideoPrism: A Foundational Visual Encoder for Video Understanding" (ICML 2024)

Python

394

51 commits

updated Sep 16, 2026

See the code

README

VideoPrism: A Foundational Visual Encoder for Video Understanding

Paper Blog Video Encoder Colab Demo Video-Text Encoder Colab Demo Video Classification Colab Demo HuggingFace License

VideoPrism is a general-purpose video encoder designed to handle a wide spectrum of video understanding tasks, including classification, retrieval, localization, captioning, and question answering. It is pre-trained on a massive and diverse dataset: 1 billion image-text pairs from WebLI, 36 million high-quality video-text pairs, and 582 million video clips with noisy or machine-generated parallel text (subject to data wipeout). The pre-training approach is designed for these hybrid data, to learn both from video-text pairs and the videos themselves. VideoPrism is fairly easy to adapt to new video understanding tasks, and achieves state-of-the-art performance on 31 out of 33 public video understanding benchmarks using a single frozen model.

This repository releases the model weight checkpoints and hosts JAX/Flax utility functions for checkpoint loading and model inference.

Updates

  • [Mar-13-26]: Added video classification fine-tuning with the frozen backbone [Colab notebook]. :fire::fire:
  • [Jul-16-25]: Released VideoPrism video-text encoders for cross-modal retrieval [Colab notebook]. :fire::fire:
  • [Jun-15-25]: Added models to [Hugging Face].
  • [Jun-05-25]: Added video encoder demo [Colab notebook].
  • [Jun-03-25]: Released VideoPrism video encoders (Base and Large) [Blog] [Paper]. :fire::fire:

TODOs

  • Add PyTorch model support.

Getting started

You will need Python 3.9 or later. Download the code from GitHub and run:

$ git clone https://github.com/google-deepmind/videoprism.git
$ cd videoprism
$ pip install .

Please get started with the following example code for model checkpoint loading and inference or use the Colab notebook for video encoders / Colab notebook for video-text encoders:

import jax
from videoprism import models as vp

# Video encoders.
model_name = 'videoprism_public_v1_base'  # configuration name
flax_model = vp.get_model(model_name)
loaded_state = vp.load_pretrained_weights(model_name)

@jax.jit
def forward_fn(inputs):
  return flax_model.apply(loaded_state, inputs, train=False)

video_inputs = ...  # Shape = [batch_size, num_frames, height, width, 3].
outputs, _ = forward_fn(video_inputs)  # Shape = [batch_size, num_tokens, feature_channels].

# Video-text encoders.
model_name = 'videoprism_lvt_public_v1_base'  # configuration name
flax_model = vp.get_model(model_name)
loaded_state = vp.load_pretrained_weights(model_name)
text_tokenizer = vp.load_text_tokenizer('c4_en')

@jax.jit
def forward_fn(inputs, text_token_ids, text_token_paddings, train=False):
  return flax_model.apply(
      loaded_state,
      inputs,
      text_token_ids,
      text_token_paddings,
      train=train,
  )

video_inputs = ...  # Shape = [batch_size, num_frames, height, width, 3].
text_queries = ...  # A list of input text queries.
text_ids, text_paddings = vp.tokenize_texts(text_tokenizer, text_queries)
video_embeddings, text_embeddings, _ = forward_fn(
  video_inputs, text_ids, text_paddings)  # Shape = [batch_size, feature_channels].

Video Classification example

We provide a Colab notebook for video classification to show how to fine-tune VideoPrism for video classification by keeping the pre-trained backbone frozen and training only a lightweight attention-pooler + projection head.

Released models

We release the following model variants:

Model NameConfiguration NameModel TypeBackbone#ParamsFile SizeCheckpoint
VideoPrism-Bvideoprism_public_v1_baseVideo encoderViT-B114M458MBlink
VideoPrism-Lvideoprism_public_v1_largeVideo encoderViT-L354M1.42GBlink
VideoPrism-LvT-Bvideoprism_lvt_public_v1_baseVideo-text encodersViT-B248M991MBlink
VideoPrism-LvT-Lvideoprism_lvt_public_v1_largeVideo-text encodersViT-L580M2.30GBlink

Video encoders take videos with shape (batch_size, num_frames, 288, 288, 3) as inputs and output embeddings with shape (batch_size, num_frames * 16 * 16, feature_channels) which could be reshaped into (batch_size, num_frames, 16, 16, feature_channels) for spatiotemporal representations. During model training, num_frames is set to 16 and 8 for VideoPrism-B and VideoPrism-L, respectively. Both models are expected to work with arbitrary num_frames by interpolating the temporal positional embeddings. The RGB values of input videos should be normalized in [0.0, 1.0].

In video-text models, both video and text encoders produce global embeddings with shape (batch_size, feature_channels), whose similarities could be measured by cosine distances. We use the c4_en SentencePiece model for text tokenization. During inference, embedding calculation for either modality can be skipped by providing None as the input.

Results with frozen backbones

"Public" denotes models we released in this repository. "Paper" and "Prior SOTA" denote our models and previous best-performing models reported in the paper, respectively. Our public models perform slightly worse than the paper models due to different pre-training image-text data we used subject to data policy.

Video-focused tasks (VideoGLUE)

ModelsK400MiTSSv2D48CharadesActivityNetAVAAVA-K
VideoPrism-B (public)82.939.762.264.343.536.528.330.8
VideoPrism-L (public)85.043.364.667.653.237.032.434.5
VideoPrism-B (paper)84.240.863.667.440.436.630.631.8
VideoPrism-g (paper)87.245.568.571.362.337.836.237.3
Prior SOTA (B)77.134.058.255.633.335.821.125.9
Prior SOTA (L+)82.840.367.469.639.936.724.426.2

Zero-shot video-text retrieval

ModelsMSRVTT-1K (v2t)MSRVTT-1K (t2v)VATEX (v2t)VATEX (t2v)ActivityNet (v2t)ActivityNet (t2v)
VideoPrism-LvT-B (public)49.850.173.156.247.948.8
VideoPrism-LvT-L (public)50.650.175.057.249.151.3
VideoPrism-LvT-B (paper)50.251.476.257.747.949.6
VideoPrism-LvT-g (paper)51.752.777.162.550.352.7
Prior SOTA (B)-34.0---30.6
Prior SOTA (L+)45.443.973.653.240.742.8

Zero-shot video classification

ModelsK400SSv2 (Temporal)SSv2 (Events)NExT-QA (Hard)CharadesCharades (STA)
VideoPrism-LvT-B (public)69.214.611.331.126.948.6
VideoPrism-LvT-L (public)72.418.012.432.132.450.2
VideoPrism-LvT-B (paper)71.316.111.931.329.250.0
VideoPrism-LvT-g (paper)74.618.615.732.732.450.4
Prior SOTA (B)-9.86.427.621.1-
Prior SOTA (L+)72.015.211.425.225.847.2

Citation

If you use VideoPrism, please cite the following papers:

@inproceedings{zhao2024videoprism,
  title = {{VideoPrism}: A Foundational Visual Encoder for Video Understanding},
  author = {Long Zhao and Nitesh B. Gundavarapu and Liangzhe Yuan and Hao Zhou and Shen Yan and Jennifer J. Sun and Luke Friedman and Rui Qian and Tobias Weyand and Yue Zhao and Rachel Hornung and Florian Schroff and Ming-Hsuan Yang and David A. Ross and Huisheng Wang and Hartwig Adam and Mikhail Sirotenko and Ting Liu and Boqing Gong},
  booktitle = {International Conference on Machine Learning (ICML)},
  year = {2024}
}

@article{yuan2024videoglue,
  title = {{VideoGLUE}: Video General Understanding Evaluation of Foundation Models},
  author = {Liangzhe Yuan and Nitesh Bharadwaj Gundavarapu and Long Zhao and Hao Zhou and Yin Cui and Lu Jiang and Xuan Yang and Menglin Jia and Tobias Weyand and Luke Friedman and Mikhail Sirotenko and Huisheng Wang and Florian Schroff and Hartwig Adam and Ming-Hsuan Yang and Ting Liu and Boqing Gong},
  journal = {Transactions on Machine Learning Research (TMLR)},
  year = {2024}
}

@article{sun2024video,
  title={Video foundation models for animal behavior analysis},
  author={Sun, Jennifer J and Zhou, Hao and Yang, Xinyu and Zhao, Long and Yuan, Liangzhe and Seybold, Bryan and Hendon, David and Schroff, Florian and Ross, David A and Adam, Hartwig and Hu, Bo and Liu, Ting},
  journal={bioRxiv},
  pages={2024--07},
  year={2024},
  publisher={Cold Spring Harbor Laboratory}
}

License

Copyright 2025 Google LLC

All software is licensed under the Apache License, Version 2.0 (Apache 2.0); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the Apache 2.0 license at: https://www.apache.org/licenses/LICENSE-2.0

All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at: https://creativecommons.org/licenses/by/4.0/legalcode

Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.

Disclaimer

This is not an official Google product.

self-supervised-learning
video-foundation-model
vision-language-model
vision-transformer

Contributors

garyzhao

29 commits

tingliu

14 commits

jenjsun

6 commits

AleksMat

1 commits

google-deepmind/videoprism

Official repository for "VideoPrism: A Foundational Visual Encoder for Video Understanding" (ICML 2024)

Python

394

51 commits

updated Sep 16, 2026

See the code

README

VideoPrism: A Foundational Visual Encoder for Video Understanding

Paper Blog Video Encoder Colab Demo Video-Text Encoder Colab Demo Video Classification Colab Demo HuggingFace License

VideoPrism is a general-purpose video encoder designed to handle a wide spectrum of video understanding tasks, including classification, retrieval, localization, captioning, and question answering. It is pre-trained on a massive and diverse dataset: 1 billion image-text pairs from WebLI, 36 million high-quality video-text pairs, and 582 million video clips with noisy or machine-generated parallel text (subject to data wipeout). The pre-training approach is designed for these hybrid data, to learn both from video-text pairs and the videos themselves. VideoPrism is fairly easy to adapt to new video understanding tasks, and achieves state-of-the-art performance on 31 out of 33 public video understanding benchmarks using a single frozen model.

This repository releases the model weight checkpoints and hosts JAX/Flax utility functions for checkpoint loading and model inference.

Updates

  • [Mar-13-26]: Added video classification fine-tuning with the frozen backbone [Colab notebook]. :fire::fire:
  • [Jul-16-25]: Released VideoPrism video-text encoders for cross-modal retrieval [Colab notebook]. :fire::fire:
  • [Jun-15-25]: Added models to [Hugging Face].
  • [Jun-05-25]: Added video encoder demo [Colab notebook].
  • [Jun-03-25]: Released VideoPrism video encoders (Base and Large) [Blog] [Paper]. :fire::fire:

TODOs

  • Add PyTorch model support.

Getting started

You will need Python 3.9 or later. Download the code from GitHub and run:

$ git clone https://github.com/google-deepmind/videoprism.git
$ cd videoprism
$ pip install .

Please get started with the following example code for model checkpoint loading and inference or use the Colab notebook for video encoders / Colab notebook for video-text encoders:

import jax
from videoprism import models as vp

# Video encoders.
model_name = 'videoprism_public_v1_base'  # configuration name
flax_model = vp.get_model(model_name)
loaded_state = vp.load_pretrained_weights(model_name)

@jax.jit
def forward_fn(inputs):
  return flax_model.apply(loaded_state, inputs, train=False)

video_inputs = ...  # Shape = [batch_size, num_frames, height, width, 3].
outputs, _ = forward_fn(video_inputs)  # Shape = [batch_size, num_tokens, feature_channels].

# Video-text encoders.
model_name = 'videoprism_lvt_public_v1_base'  # configuration name
flax_model = vp.get_model(model_name)
loaded_state = vp.load_pretrained_weights(model_name)
text_tokenizer = vp.load_text_tokenizer('c4_en')

@jax.jit
def forward_fn(inputs, text_token_ids, text_token_paddings, train=False):
  return flax_model.apply(
      loaded_state,
      inputs,
      text_token_ids,
      text_token_paddings,
      train=train,
  )

video_inputs = ...  # Shape = [batch_size, num_frames, height, width, 3].
text_queries = ...  # A list of input text queries.
text_ids, text_paddings = vp.tokenize_texts(text_tokenizer, text_queries)
video_embeddings, text_embeddings, _ = forward_fn(
  video_inputs, text_ids, text_paddings)  # Shape = [batch_size, feature_channels].

Video Classification example

We provide a Colab notebook for video classification to show how to fine-tune VideoPrism for video classification by keeping the pre-trained backbone frozen and training only a lightweight attention-pooler + projection head.

Released models

We release the following model variants:

Model NameConfiguration NameModel TypeBackbone#ParamsFile SizeCheckpoint
VideoPrism-Bvideoprism_public_v1_baseVideo encoderViT-B114M458MBlink
VideoPrism-Lvideoprism_public_v1_largeVideo encoderViT-L354M1.42GBlink
VideoPrism-LvT-Bvideoprism_lvt_public_v1_baseVideo-text encodersViT-B248M991MBlink
VideoPrism-LvT-Lvideoprism_lvt_public_v1_largeVideo-text encodersViT-L580M2.30GBlink

Video encoders take videos with shape (batch_size, num_frames, 288, 288, 3) as inputs and output embeddings with shape (batch_size, num_frames * 16 * 16, feature_channels) which could be reshaped into (batch_size, num_frames, 16, 16, feature_channels) for spatiotemporal representations. During model training, num_frames is set to 16 and 8 for VideoPrism-B and VideoPrism-L, respectively. Both models are expected to work with arbitrary num_frames by interpolating the temporal positional embeddings. The RGB values of input videos should be normalized in [0.0, 1.0].

In video-text models, both video and text encoders produce global embeddings with shape (batch_size, feature_channels), whose similarities could be measured by cosine distances. We use the c4_en SentencePiece model for text tokenization. During inference, embedding calculation for either modality can be skipped by providing None as the input.

Results with frozen backbones

"Public" denotes models we released in this repository. "Paper" and "Prior SOTA" denote our models and previous best-performing models reported in the paper, respectively. Our public models perform slightly worse than the paper models due to different pre-training image-text data we used subject to data policy.

Video-focused tasks (VideoGLUE)

ModelsK400MiTSSv2D48CharadesActivityNetAVAAVA-K
VideoPrism-B (public)82.939.762.264.343.536.528.330.8
VideoPrism-L (public)85.043.364.667.653.237.032.434.5
VideoPrism-B (paper)84.240.863.667.440.436.630.631.8
VideoPrism-g (paper)87.245.568.571.362.337.836.237.3
Prior SOTA (B)77.134.058.255.633.335.821.125.9
Prior SOTA (L+)82.840.367.469.639.936.724.426.2

Zero-shot video-text retrieval

ModelsMSRVTT-1K (v2t)MSRVTT-1K (t2v)VATEX (v2t)VATEX (t2v)ActivityNet (v2t)ActivityNet (t2v)
VideoPrism-LvT-B (public)49.850.173.156.247.948.8
VideoPrism-LvT-L (public)50.650.175.057.249.151.3
VideoPrism-LvT-B (paper)50.251.476.257.747.949.6
VideoPrism-LvT-g (paper)51.752.777.162.550.352.7
Prior SOTA (B)-34.0---30.6
Prior SOTA (L+)45.443.973.653.240.742.8

Zero-shot video classification

ModelsK400SSv2 (Temporal)SSv2 (Events)NExT-QA (Hard)CharadesCharades (STA)
VideoPrism-LvT-B (public)69.214.611.331.126.948.6
VideoPrism-LvT-L (public)72.418.012.432.132.450.2
VideoPrism-LvT-B (paper)71.316.111.931.329.250.0
VideoPrism-LvT-g (paper)74.618.615.732.732.450.4
Prior SOTA (B)-9.86.427.621.1-
Prior SOTA (L+)72.015.211.425.225.847.2

Citation

If you use VideoPrism, please cite the following papers:

@inproceedings{zhao2024videoprism,
  title = {{VideoPrism}: A Foundational Visual Encoder for Video Understanding},
  author = {Long Zhao and Nitesh B. Gundavarapu and Liangzhe Yuan and Hao Zhou and Shen Yan and Jennifer J. Sun and Luke Friedman and Rui Qian and Tobias Weyand and Yue Zhao and Rachel Hornung and Florian Schroff and Ming-Hsuan Yang and David A. Ross and Huisheng Wang and Hartwig Adam and Mikhail Sirotenko and Ting Liu and Boqing Gong},
  booktitle = {International Conference on Machine Learning (ICML)},
  year = {2024}
}

@article{yuan2024videoglue,
  title = {{VideoGLUE}: Video General Understanding Evaluation of Foundation Models},
  author = {Liangzhe Yuan and Nitesh Bharadwaj Gundavarapu and Long Zhao and Hao Zhou and Yin Cui and Lu Jiang and Xuan Yang and Menglin Jia and Tobias Weyand and Luke Friedman and Mikhail Sirotenko and Huisheng Wang and Florian Schroff and Hartwig Adam and Ming-Hsuan Yang and Ting Liu and Boqing Gong},
  journal = {Transactions on Machine Learning Research (TMLR)},
  year = {2024}
}

@article{sun2024video,
  title={Video foundation models for animal behavior analysis},
  author={Sun, Jennifer J and Zhou, Hao and Yang, Xinyu and Zhao, Long and Yuan, Liangzhe and Seybold, Bryan and Hendon, David and Schroff, Florian and Ross, David A and Adam, Hartwig and Hu, Bo and Liu, Ting},
  journal={bioRxiv},
  pages={2024--07},
  year={2024},
  publisher={Cold Spring Harbor Laboratory}
}

License

Copyright 2025 Google LLC

All software is licensed under the Apache License, Version 2.0 (Apache 2.0); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the Apache 2.0 license at: https://www.apache.org/licenses/LICENSE-2.0

All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at: https://creativecommons.org/licenses/by/4.0/legalcode

Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.

Disclaimer

This is not an official Google product.

self-supervised-learning
video-foundation-model
vision-language-model
vision-transformer

Contributors

garyzhao

29 commits

tingliu

14 commits

jenjsun

6 commits

AleksMat

1 commits

Languages

Python

62.9%

Jupyter Notebook

37.1%