shaoanlu / faceswap-GAN

A denoising autoencoder + adversarial losses and attention mechanisms for face swapping.
3.37k stars 842 forks source link

May I ask about the walkthrough? #3

Closed chikiuso closed 6 years ago

chikiuso commented 6 years ago

Hi, it is an amazing project and really better result than deepfakes one. About the walkthrough, do you mean :

  1. I run the dlib_video_face_detection.ipynb for person A (with input video of person A), then unzip the zip file and put it into ./TE/ folder
  2. I run the dlib_video_face_detection.ipynb for person B (with input video of person B), then unzip the zip file and put it into ./SH/ folder
  3. I run FaceSwap_GAN_github.ipynb to get the output_movie.mp4

But in the step 3, where should I set the input video in the file? Thanks.

Best Wishes, Chi Kiu SO

shaoanlu commented 6 years ago

Change input filename in the second cell of section "Make video clips w/o face alignment" at the button.

output = 'OUTPUT_VIDEO.mp4'
clip1 = VideoFileClip("TEST_VIDEO.mp4") # <= change "TEST_VIDEO.mp4"
clip = clip1.fl_image(process_video)#.subclip(11, 13) #NOTE: this function expects color images!!
%time clip.write_videofile(output, audio=False)

By the way, the reason I pack cropped images into a zip file in step1&2 is that I worked on cloud platform. I have to download the zip file to my local machine for manually data cleaning (e.g., face images which are wrongly cropped). Skip that part to save time if you are working on local machine.