Created
March 15, 2020 17:13
-
-
Save creotiv/87ee75d7c1d25d56c386fe758419de9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
predictions = make_animation(source_image, driving_video, generator, kp_detector, relative=True) | |
img_array = [] | |
h,w = predictions[0].shape[:2] | |
out = cv2.VideoWriter('/content/gdrive/My Drive/first-order-motion-model/project.avi',cv2.VideoWriter_fourcc(*'DIVX'), 30, (w,h)) | |
for f in predictions: | |
out.write((f[:, :, ::-1]*255).astype(np.uint8)) | |
out.release() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment