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.
- cv2
- numpy (by default, gets installed with opencv)
- dlib
- moviepy
- os (already comes preinstalled)
- glob (already comes preinstalled)
- Clone the repository in your pc.
- 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.
- 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.
- Open the folder in your python ide and run the code. Wait for sometime and have a glass of water😀.
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.