1 #ifndef FACE_SWAP_CNN_3DMM_H 2 #define FACE_SWAP_CNN_3DMM_H 5 #include <opencv2/core.hpp> 8 #include <caffe/caffe.hpp> 36 CNN3DMM(
const std::string& deploy_file,
const std::string& caffe_model_file,
37 const std::string& mean_file,
bool init_cnn =
true,
38 bool with_gpu =
true,
int gpu_device_id = 0);
49 void process(
const cv::Mat& img,
50 cv::Mat& shape_coefficients, cv::Mat& tex_coefficients);
53 void wrapInputLayer(std::vector<cv::Mat>& input_channels);
55 cv::Mat readMean(
const std::string& mean_file)
const;
57 cv::Mat preprocess(
const cv::Mat& img);
59 void copyInputData(cv::Mat& img);
62 std::shared_ptr<caffe::Net<float> > m_net;
64 cv::Size m_input_size;
71 #endif // FACE_SWAP_CNN_3DMM_H CNN3DMM(const std::string &deploy_file, const std::string &caffe_model_file, const std::string &mean_file, bool init_cnn=true, bool with_gpu=true, int gpu_device_id=0)
Creates an instance of CNN3DMM.
void process(const cv::Mat &img, cv::Mat &shape_coefficients, cv::Mat &tex_coefficients)
Estimate face shape and texture from image.
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