← 开源
lucidrains

make-a-video-pytorch

Implementation of Make-A-Video, new SOTA text to video generator from Meta AI, in Pytorch

Model DevelopmentArchitecturePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.99k
Star
184
Fork
+1
本周
2
贡献者
创建于 2022-09-29 · 更新于 2026-10-13 · 今日第 9139 名
主要开发者

lucidrains/make-a-video-pytorch 排名第 9,139,有 1,989 个星标。

同类别比较

lucidrains/make-a-video-pytorch 排名第 9,139,此处有 8 个同类条目;salesforce/awd-lstm-lm 排名第 9,138。

同类别比较
名称排名指标
lucidrains/titans-pytorch9,131
语言:
Python
星标数:
1,993
分叉数:
210
简介:
Unofficial implementation of Titans, SOTA memory for transformers, in Pytorch
HobbitLong/PyContrast9,132
语言:
Python
星标数:
1,992
分叉数:
180
简介:
PyTorch implementation of Contrastive Learning methods
facebookresearch/video-nonlocal-net9,137
语言:
Python
星标数:
1,990
分叉数:
320
简介:
Non-local Neural Networks for Video Classification
salesforce/awd-lstm-lm9,138
语言:
Python
星标数:
1,990
分叉数:
484
简介:
LSTM and QRNN Language Model Toolkit for PyTorch
databricks/spark-deep-learning9,142
语言:
Python
星标数:
1,987
分叉数:
489
简介:
Deep Learning Pipelines for Apache Spark
davda54/sam9,145
语言:
Python
星标数:
1,985
分叉数:
209
简介:
SAM: Sharpness-Aware Minimization (PyTorch)
openai/maddpg9,150
语言:
Python
星标数:
1,983
分叉数:
533
简介:
Code for the MADDPG algorithm from the paper "Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments"
patrikhuber/eos9,152
语言:
C++
星标数:
1,982
分叉数:
592
简介:
A lightweight 3D Morphable Face Model library in modern C++
关键参数与规格
关键参数与规格
参数值
语言Python
类别Model Development
子类别Architecture
星标数1,989
分叉数184
贡献者2
创建日期2022-09-29
更新日期2026-10-13
1 天星标数0
7 天星标数1
排名9,139
上次排名9,181
排名变化42
7 天星标排名9,522
上次 7 天星标排名9,577
7 天星标排名变化55
总星标排名6,381
上次总星标排名6,377
总星标排名变化-4
国家USA
README 摘录

Make-A-Video - Pytorch (wip) Implementation of Make-A-Video , new SOTA text to video generator from Meta AI, in Pytorch. They combine pseudo-3d convolutions (axial convolutions) and temporal attention and show much better temporal fusion. The pseudo-3d convolutions isn't a new concept. It has been explored before in other contexts, say for protein contact prediction as "dimensional hybrid residual networks" . The gist of the paper comes down to, take a SOTA text-to-image model (here they

use DALL-E2, but the same learning points would easily apply to Imagen), make a few minor modifications for attention across time and other ways to skimp on the compute cost, do frame interpolation correctly, get a great video model out. AI Coffee Break explanation Appreciation Stability. ai for the generous sponsorship to work on cutting edge artificial intelligence research Jonathan Ho for bringing about a revolution in generative artificial intelligence through his seminal paper Alex for einops , an abstraction

that is simply genius. Install Usage Passing in video features Passing in images (if one were to pretrain on images first), both temporal convolution and attention will be automatically skipped. In other words, you can use this straightforwardly in your 2d Unet and then port it over to a 3d Unet once that phase of the training is done. The temporal modules are initialized to output identity as the paper had done.

常见问题

记录了多少星标和分叉?

lucidrains/make-a-video-pytorch 有 1,989 个星标和 184 个分叉。

仓库排名是多少?

lucidrains/make-a-video-pytorch 排名第 9,139。

记录的语言和类别是什么?

lucidrains/make-a-video-pytorch 有 1,989 个星标,语言为 Python,类别为 Model Development。

哪个仓库排名最接近?

lucidrains/make-a-video-pytorch 与 salesforce/awd-lstm-lm 比较,后者排名第 9,138,有 1,990 个星标。

README

Make-A-Video - Pytorch (wip)

Implementation of Make-A-Video, new SOTA text to video generator from Meta AI, in Pytorch. They combine pseudo-3d convolutions (axial convolutions) and temporal attention and show much better temporal fusion.

The pseudo-3d convolutions isn't a new concept. It has been explored before in other contexts, say for protein contact prediction as "dimensional hybrid residual networks".

The gist of the paper comes down to, take a SOTA text-to-image model (here they use DALL-E2, but the same learning points would easily apply to Imagen), make a few minor modifications for attention across time and other ways to skimp on the compute cost, do frame interpolation correctly, get a great video model out.

AI Coffee Break explanation

Appreciation

  • Stability.ai for the generous sponsorship to work on cutting edge artificial intelligence research

  • Jonathan Ho for bringing about a revolution in generative artificial intelligence through his seminal paper

  • Alex for einops, an abstraction that is simply genius. No other word for it.

Install

$ pip install make-a-video-pytorch

Usage

Passing in video features

import torch
from make_a_video_pytorch import PseudoConv3d, SpatioTemporalAttention

conv = PseudoConv3d(
    dim = 256,
    kernel_size = 3
)

attn = SpatioTemporalAttention(
    dim = 256,
    dim_head = 64,
    heads = 8
)

video = torch.randn(1, 256, 8, 16, 16) # (batch, features, frames, height, width)

conv_out = conv(video) # (1, 256, 8, 16, 16)
attn_out = attn(video) # (1, 256, 8, 16, 16)

Passing in images (if one were to pretrain on images first), both temporal convolution and attention will be automatically skipped. In other words, you can use this straightforwardly in your 2d Unet and then port it over to a 3d Unet once that phase of the training is done. The temporal modules are initialized to output identity as the paper had done.

import torch
from make_a_video_pytorch import PseudoConv3d, SpatioTemporalAttention

conv = PseudoConv3d(
    dim = 256,
    kernel_size = 3
)

attn = SpatioTemporalAttention(
    dim = 256,
    dim_head = 64,
    heads = 8
)

images = torch.randn(1, 256, 16, 16) # (batch, features, height, width)

conv_out = conv(images) # (1, 256, 16, 16)
attn_out = attn(images) # (1, 256, 16, 16)

You can also control the two modules so that when fed 3-dimensional features, it only does training spatially

import torch
from make_a_video_pytorch import PseudoConv3d, SpatioTemporalAttention

conv = PseudoConv3d(
    dim = 256,
    kernel_size = 3
)

attn = SpatioTemporalAttention(
    dim = 256,
    dim_head = 64,
    heads = 8
)

video = torch.randn(1, 256, 8, 16, 16) # (batch, features, frames, height, width)

# below it will not train across time

conv_out = conv(video, enable_time = False) # (1, 256, 8, 16, 16)
attn_out = attn(video, enable_time = False) # (1, 256, 8, 16, 16)

Full SpaceTimeUnet that is agnostic to images or video training, and where even if video is passed in, time can be ignored

import torch
from make_a_video_pytorch import SpaceTimeUnet

unet = SpaceTimeUnet(
    dim = 64,
    channels = 3,
    dim_mult = (1, 2, 4, 8),
    resnet_block_depths = (1, 1, 1, 2),
    temporal_compression = (False, False, False, True),
    self_attns = (False, False, False, True),
    condition_on_timestep = False,
    attn_pos_bias = False,
    flash_attn = True
).cuda()

# train on images

images = torch.randn(1, 3, 128, 128).cuda()
images_out  = unet(images)

assert images.shape == images_out.shape

# then train on videos

video = torch.randn(1, 3, 16, 128, 128).cuda()
video_out = unet(video)

assert video_out.shape == video.shape

# or even treat your videos as images

video_as_images_out = unet(video, enable_time = False)

Todo

  • [x] give attention the best positional embeddings research has to offer

  • [x] soup up the attention

  • [x] add flash attention

  • [ ] make sure dalle2-pytorch can accept SpaceTimeUnet for training

Citations

@misc{Singer2022,
    author  = {Uriel Singer},
    url     = {https://makeavideo.studio/Make-A-Video.pdf}
}
@inproceedings{rogozhnikov2022einops,
    title   = {Einops: Clear and Reliable Tensor Manipulations with Einstein-like Notation},
    author  = {Alex Rogozhnikov},
    booktitle = {International Conference on Learning Representations},
    year    = {2022},
    url     = {https://openreview.net/forum?id=oapKSVM2bcj}
}
@article{Dong2021AttentionIN,
    title   = {Attention is Not All You Need: Pure Attention Loses Rank Doubly Exponentially with Depth},
    author  = {Yihe Dong and Jean-Baptiste Cordonnier and Andreas Loukas},
    journal = {ArXiv},
    year    = {2021},
    volume  = {abs/2103.03404}
}
@article{Zhang2021TokenST,
    title   = {Token Shift Transformer for Video Classification},
    author  = {Hao Zhang and Y. Hao and Chong-Wah Ngo},
    journal = {Proceedings of the 29th ACM International Conference on Multimedia},
    year    = {2021}
}
@inproceedings{shleifer2022normformer,
    title   = {NormFormer: Improved Transformer Pretraining with Extra Normalization},
    author  = {Sam Shleifer and Myle Ott},
    booktitle = {Submitted to The Tenth International Conference on Learning Representations },
    year    = {2022},
    url     = {https://openreview.net/forum?id=GMYWzWztDx5},
}
@inproceedings{dao2022flashattention,
    title   = {Flash{A}ttention: Fast and Memory-Efficient Exact Attention with {IO}-Awareness},
    author  = {Dao, Tri and Fu, Daniel Y. and Ermon, Stefano and Rudra, Atri and R{\'e}, Christopher},
    booktitle = {Advances in Neural Information Processing Systems},
    year    = {2022}
}
排名相邻
同类项目