Some Thoughts face replacement (FaceSwap) of

This link: https: //blog.csdn.net/cy1070779077/article/details/85224347
face replacement (FaceSwap) Some think

The very beginning, I used openCV (a learning machine vision library) is a more professional tutorial (also use face detection before this) way to provide people in the face of an alternative. The main idea is assumed that the face A to the face B is replaced, detected first face A and the face B of the face flag (facial landmarks, including the position of the feature point of many eyes, nose, mouth, etc.), for all the feature points face B a convex hull structure , a point on the convex hull (outer boundary) connected two by two, can be divided into many small triangles , then each of these thoughts derivative using alternative small triangle (affine transformation) corresponding to the position of the face a , finally let openCV provides results in Figure seem natural look of some of the handler ( Poisson clone , Seamless cloning).

In fact, this approach more human face on the image to replace applications has been relatively sufficient, such as drawing output.jpg, it was originally Trump's face, in order to replace Ted Cruze's face (though some do not at first glance naturally, but the overall feeling is good)


Next, I use Premiere made some simple little video, in essence, is the Trump zooming and moving pictures. Then we replaced the faces in a video experiments, to obtain the output video. It is easy to find problems, is the jitter in the video face.

(This method is more than before and I like the modular application process, to achieve a relatively simple step, but due to different expectations, it may give satisfaction will be very different. Like face detection, we are bounding box In fact, there are jitters have little effect, but face replacement is not.)

On the causes of facial shake, I thought a moment, mainly because of the relative position of each should face the face detection marker when each frame resulting volatility caused. More simply, it may be from 20 pixels between the nose and the mouth of the first marker 1, but may be from 25 pixels between the nose and mouth markers of two, because we sent a human face is detected in a model corresponding to a whole image, the size of the face and the face in this position will affect the whole picture of the relative position between the face position and the final marker for each marker point. Resulting in a problem of jitter face from the first frame to the second frame may occur.

So I looked up at the others face replacement method.

The first is DeepFakes, it is done using the depth image generation neural networks. I basically looked at the basic idea, simply, suppose you want to replace face to face A B, then we will own picture distortion of the face B are a variety of ways (twisted way it should be luxurious), give a large number of collections S_B distortion of the picture, we train a neural network model M depth can S_B in each of the twisted face reduced to face B, then we face into the a model M, so that we can better achieve the A face to face replace B.

The second is DeepFaceLab, just generally looked tensorflow need to use machine learning framework.

Both of these methods and the first method a different start. The first method is just beginning to use the face detection process in the idea of machine learning, using a predictive model pretrained, but the real time to replace the affine transformation simply do it; but if it is the latter two more thorough and complete use of machine learning methods to replace face life, the effect should be personal feeling a lot better. But the two methods if you want to make better use of it may have to spend a lot of time to configure the environment, understand the technical details.
----------------
Disclaimer: This article is the original article CSDN bloggers "RoyChen97", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement. .
Original link: https: //blog.csdn.net/cy1070779077/article/details/85224347

Guess you like

Origin www.cnblogs.com/Ph-one/p/11770913.html