Nirkin Face Swap  0.9.0
Face swap.
basel_3dmm.h
1 #ifndef FACE_SWAP_BASEL_3DMM_H
2 #define FACE_SWAP_BASEL_3DMM_H
3 
4 // Includes
5 #include <opencv2/core.hpp>
6 
7 #include <string>
8 
9 namespace face_swap
10 {
13  struct Mesh
14  {
19  static void save_ply(const Mesh& mesh, const std::string& ply_file);
20 
21  cv::Mat vertices;
22  cv::Mat colors;
23  cv::Mat faces;
24  cv::Mat uv;
25  cv::Mat tex;
26  cv::Mat normals;
27  };
28 
35  struct Basel3DMM
36  {
41  Mesh sample(const cv::Mat& shape_coefficients,
42  const cv::Mat& tex_coefficients);
43 
49  Mesh sample(const cv::Mat& shape_coefficients,
50  const cv::Mat& tex_coefficients, const cv::Mat& expr_coefficients);
51 
55  static Basel3DMM load(const std::string& model_file);
56 
57  cv::Mat faces;
58  cv::Mat shapeMU, shapePC, shapeEV;
59  cv::Mat texMU, texPC, texEV;
60  cv::Mat exprMU, exprPC, exprEV;
61  };
62 
63 } // namespace face_swap
64 
65 #endif // FACE_SWAP_BASEL_3DMM_H
Represents a 3D renderable shape.
Definition: basel_3dmm.h:13
Definition: basel_3dmm.h:9
Represents Basel&#39;s 3D Morphable Model.
Definition: basel_3dmm.h:35
static void save_ply(const Mesh &mesh, const std::string &ply_file)
Save mesh to a ply file.