videogpt inference

Former-commit-id: c5d617450a8271ad3b8a5e8f76ee2d77a822e31b
This commit is contained in:
LinB203
2024-03-07 16:44:19 +08:00
parent 11996dc9b4
commit 784c246e9c
@@ -89,8 +89,9 @@ def main(args):
x_vae = preprocess(read_video(video_path, num_frames, sample_rate), resolution, crop_size)
x_vae = x_vae.to(device)
encodings, embeddings = vqvae.encode(x_vae, include_embeddings=True)
video_recon = vqvae.decode(encodings)
with torch.no_grad():
encodings, embeddings = vqvae.encode(x_vae, include_embeddings=True)
video_recon = vqvae.decode(encodings)
# custom_to_video(x_vae[0], fps=sample_fps/sample_rate, output_file='origin_input.mp4')
custom_to_video(video_recon[0], fps=sample_fps/sample_rate, output_file=args.rec_path)