How does three implement face replacement functionality

How to achieve three face replacement function, such as the video shows below, I hope you can provide effective solutions and ideas thank you

20170726115826585