吴吴大庸
updated the project based on https://huggingface.co/spaces/LanguageBind/Open-Sora-Plan-v1.1.0/tree/main
a5130bc
raw
history blame contribute delete
239 Bytes
import torch
import numpy as np
def tensor_to_video(x):
x = x.detach().cpu()
x = torch.clamp(x, -1, 1)
x = (x + 1) / 2
x = x.permute(1, 0, 2, 3).float().numpy() # c t h w ->
x = (255 * x).astype(np.uint8)
return x