You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en_US/tutorials/motion_driving.md
+50-3Lines changed: 50 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -9,22 +9,23 @@
9
9
</div>
10
10
## Multi-Faces swapping
11
11
12
-
For photoes with multiple faces, we first detect all of the faces, then do facial expression transfer for each face, and finally put those faces back to the original photo to generate a complete new video.
12
+
For photoes with multiple faces, we first detect all of the faces, then do facial expression transfer for each face, and finally put those faces back to the original photo to generate a complete new video.
13
13
14
14
Specific technical steps are shown below:
15
15
16
16
1. Use the S3FD model to detect the faces of a photo
17
17
2. Use the First Order Motion model to do the facial expression transfer of each face
18
18
3. Put those "new" generated faces back to the original photo
19
19
20
-
At the same time, specifically for face related work, PaddleGAN provides a ["faceutils" tool](https://github.com/PaddlePaddle/PaddleGAN/tree/develop/ppgan/faceutils), including face detection, face segmentation models and more.
20
+
At the same time, specifically for face related work, PaddleGAN provides a ["faceutils" tool](https://github.com/PaddlePaddle/PaddleGAN/tree/develop/ppgan/faceutils), including face detection, face segmentation models and more.
21
21
22
22
## How to use
23
-
23
+
### 1 Test for Face
24
24
Users can upload the prepared source image and driving video, then substitute the path of source image and driving video for the `source_image` and `driving_video` parameter in the following running command. It will geneate a video file named `result.mp4` in the `output` folder, which is the animated video file.
25
25
26
26
Note: for photoes with multiple faces, the longer the distances between faces, the better the result quality you can get.
- driving_video: driving video, the motion of the driving video is to be migrated.
39
48
- source_image: source_image, support single people and multi-person in the image, the image will be animated according to the motion of the driving video.
40
49
- relative: indicate whether the relative or absolute coordinates of the key points in the video are used in the program. It is recommended to use relative coordinates. If absolute coordinates are used, the characters will be distorted after animation.
41
50
- adapt_scale: adapt movement scale based on convex hull of keypoints.
42
51
- ratio: The pasted face percentage of generated image, this parameter should be adjusted in the case of multi-person image in which the adjacent faces are close. The defualt value is 0.4 and the range is [0.4, 0.5].
52
+
- multi_person: There are multi faces in the images. Default means only one face in the image
0 commit comments