yoyo-nb / Thin-Plate-Spline-Motion-Model

[CVPR 2022] Thin-Plate Spline Motion Model for Image Animation.
MIT License
3.44k stars 558 forks source link

Keep all frames in a folder #35

Open Norias opened 1 year ago

Norias commented 1 year ago

Hi, To uspcale the video we need to have all frames in a folder, to upscale them one by one. We can extract all the frames with ffmpeg, but the pictures are slightly damaged by the video compression. So it would be nice to be able to keep all the frames in better quality in a folder. Is it possible ?

yoyo-nb commented 1 year ago

Actually the TPSMM algorithm generates images frame by frame and then stitches them into a video, so you can save all the generated images in your folder before this line.

predictions is a list that holds the generated images for each frame.

For example:

import cv2
from skimage import img_as_ubyte
for i in rangle(len(predictions)):
    cv2.imwrite(f'{i}.png', img_as_ubyte(predictions[i][:,:,::-1]))