C++ implementation of PRNet on iOS
This project contains:
- Face reconstruct(Face swap) from only a single image.
- Face pose estimate and keypoints(68) in 3D model.
The origin python code with training is in PRNet.
Platfrom and requirements
1. iPhone SE, arm64 2. OpenCV 3.4.0 3. NCNN
- Mtcnn --> resize to 256x256 --> PRNet --> UV,Z --> Render 86906 triangles in 3D --> SeamlessClone
- Mtcnn --> resize to 256x256 --> PRNet --> 43867 vertices --> SVD to estimate pose
Mtcnn --> resize to 256x256 --> PRNet --> 43867 vertices --> pick 68 points for sparse alignment
- Face Swap, change the target face image(@"ref.jpg") to your own.
- Face 3D pose estimate and face keypoints in 3D.
About the configuration
There's 4 config files in this project.
This file is the index of [0,65535], which is the region of the WHITE area of the image[256x256] below.
This file is the index of coordinate(x,y) for 68 keypoints refer to face_ind.txt
86906 triangles' vertices index refer to face_ind.txt
canonical model for pose estimate, there's coordinate (uv,z) of 43867 vertices
- About the Euler angles.
- 3D points transformation matrix.
- Render 3D texture.