The advent of text-to-video models like Phenaki has opened new horizons in artificial intelligence, enabling the transformation of textual descriptions into visual narratives. In this guide, we’ll take you through the reproduction process of the first step of the Phenaki model using the Transformer-based autoencoder known as CViViT. Let’s embark on this exciting journey!
Getting Started
Before diving into the code, ensure you have the necessary prerequisites:
- Python installed on your machine.
- PyTorch and relevant libraries.
- Access to a capable GPU (recommended for training).
Key Features of CViViT
The CViViT model incorporates several enhancements over the original Phenaki architecture. Here are some notable features:
- Incorporation of I3D video loss for better training performance.
- Optimized loss weights and architecture parameters aligned closely with the research paper.
- Learning rate schedulers such as warmup and annealing for efficient training.
- Integration with WebDataset for seamless access to data.
- Specific video data preprocessing (8fps, 11 frames per video).
- Multi-GPU and multi-node training compatibility.
- Enhanced visualization scripts and minor bug fixes.
Code Implementation
The code required to reproduce the Phenaki CViViT model is primarily based on the work of lucidrains. Below we’ll explore the process of implementing the model using an analogy for clarity.
Think of CViViT as a master chef (the model) preparing a gourmet meal (the video). To create this masterpiece, the chef requires quality ingredients (video data), a precise recipe (the code), and the right kitchen appliances (computational resources). Just like how altering cooking times or ingredient ratios can affect the dish’s outcome, modifications in model architecture, loss functions, and training methods directly influence the performance and results of the CViViT. The chef must stay updated on cooking techniques (continuously improve and adjust) to ensure the meal reflects the chef’s intent and satisfies the diners (the users).
# Sample Code Snippet for Model Training
# Import necessary libraries
import torch
from cvivit_model import CViViT
# Initialize and configure the model
model = CViViT(...params...)
# Prepare the dataset
train_data = load_data('path_to_video_dataset')
# Training Loop
for epoch in range(num_epochs):
for batch in train_data:
# Train the model on the batch
model.train_on_batch(batch)
Model Weight Release
The model weights, showcasing the best training outcomes, are available on Hugging Face. The CViViT model is trained on the Webvid-10M dataset with a multi-GPU setup. Examples of videos and reconstructions made by the model are included in the repository. See remarkable outputs with the Obvious Research logo or the iconic blue-red pill from The Matrix!
Usage for Inference
To test the model, follow these steps:
- Clone the GitHub repository.
- Download the CVIVIT and frozen_models folders from the repo.
- Ensure your input images are structured as 8 FPS videos comprising 11 frames.
- Run the
CViViT_inference.ipynbnotebook to perform inference.
Troubleshooting
If you encounter issues while running the model, consider the following troubleshooting tips:
- Ensure your Python and library installations are up-to-date.
- Check if your data preprocessing aligns with the model’s requirements.
- Verify the compatibility of hardware and software setups for multi-GPU training.
- If you need further insights, feel free to reach out via @obv_research or email research.obvious@gmail.com.
- For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Next Steps
The Obvious Research team is currently working on the second phase of training for Phenaki, which aims to complete the full text-to-video model. We welcome any assistance and collaboration in this groundbreaking project.
About Obvious Research
Obvious Research is committed to advancing AI artistic tools. Established by the artists’ trio Obvious, in partnership with La Sorbonne Université, we are dedicated to innovating in the field of artificial intelligence.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

