Skip to content

Instantly share code, notes, and snippets.

@creotiv
Created March 15, 2020 17:13
Show Gist options
  • Save creotiv/87ee75d7c1d25d56c386fe758419de9e to your computer and use it in GitHub Desktop.
Save creotiv/87ee75d7c1d25d56c386fe758419de9e to your computer and use it in GitHub Desktop.
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