Skip to content

Dhruv1420/Face-Swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Swap

A face swapping tool, to swap the face in a video with the face in a photo. A folder of photos, where each photo swaps over the folder of videos, outputs the face swapped videos. If you are a developer, you are encouraged to go through the code.

Google Colab

Packages Installation

  • cv2
  • numpy (by default, gets installed with opencv)
  • dlib
  • moviepy
  • os (already comes preinstalled)
  • glob (already comes preinstalled)

How to Use

  1. Clone the repository in your pc.
  2. The 'photos' and 'videos' folder, and "shape_predictor_68_face_landmarks.dat" file should be present in the same directory as that of the "face swap.py" file.
  3. Put some photos in the 'photos' folder and some videos in the 'videos' folder. Remember that the video must be in the .mp4 format. It is suggested to use .jpg format as the file container of the photos.
  4. Open the folder in your python ide and run the code. Wait for sometime and have a glass of water😀.

Result

After the code is executed, the result folder will be created in the same directory, containing a bunch of face swapped videos, made by the swapping of the face in each video, with the face in each photo. If we have used 4 photos and 3 videos, the "result" folder will contain 4*3, i.e., 12 face swapped videos.

Some Results

Video

video.mp4

Photo

photo

Face Swapped Result

video_photo.mp4

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages