Nirkin Face Swap  0.9.0
Face swap.
cnn_3dmm_expr.h
1 #ifndef FACE_SWAP_CNN_3DMM_EXPR_H
2 #define FACE_SWAP_CNN_3DMM_EXPR_H
3 
4 
5 #include "cnn_3dmm.h"
6 
7 class FaceServices2;
8 
9 namespace face_swap
10 {
21  class CNN3DMMExpr : public CNN3DMM
22  {
23  public:
24 
35  CNN3DMMExpr(const std::string& deploy_file, const std::string& caffe_model_file,
36  const std::string& mean_file, const std::string& model_file,
37  bool generic = false, bool with_expr = true,
38  bool with_gpu = true, int gpu_device_id = 0);
39 
42  ~CNN3DMMExpr();
43 
54  void process(const cv::Mat& img, const std::vector<cv::Point>& landmarks,
55  cv::Mat& shape_coefficients, cv::Mat& tex_coefficients,
56  cv::Mat& expr_coefficients, cv::Mat& vecR, cv::Mat& vecT, cv::Mat& K);
57  private:
58  std::unique_ptr<FaceServices2> fservice;
59  bool m_generic, m_with_expr;
60  };
61 
62 } // namespace face_swap
63 
64 #endif // FACE_SWAP_CNN_3DMM_EXPR_H
void process(const cv::Mat &img, const std::vector< cv::Point > &landmarks, cv::Mat &shape_coefficients, cv::Mat &tex_coefficients, cv::Mat &expr_coefficients, cv::Mat &vecR, cv::Mat &vecT, cv::Mat &K)
Estimate face pose and shape, texture, expression coefficients from image.
This class provided face shape, texture, expression and pose estimations using Caffe with a convoluti...
Definition: cnn_3dmm_expr.h:21
~CNN3DMMExpr()
Destructor.
This class provided face shape and texture estimation using Caffe with a convolutional neural network...
Definition: cnn_3dmm.h:24
Definition: basel_3dmm.h:9
CNN3DMMExpr(const std::string &deploy_file, const std::string &caffe_model_file, const std::string &mean_file, const std::string &model_file, bool generic=false, bool with_expr=true, bool with_gpu=true, int gpu_device_id=0)
Creates an instance of CNN3DMMExpr.