faceLandmarks.h 931 Bytes
#ifndef FACELANDMARKS_H
#define FACELANDMARKS_H

#include <opencv2/opencv.hpp>
#include<MNN/Interpreter.hpp>
#include<MNN/ImageProcess.hpp>
#include<iostream>

using namespace std;
using namespace cv;
using namespace MNN;

class FaceLandmarks{
    private:
        vector<float> input_size={112,112};
        std::shared_ptr<MNN::Interpreter> net;
        Session *session = nullptr;
        ScheduleConfig config;
        
    public:
        FaceLandmarks(){};
        FaceLandmarks(string model_path){
            net = std::shared_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile(model_path.c_str()));//创建解释器
            config.numThread = 8;
            config.type = MNN_FORWARD_CPU;
            session = net->createSession(config);//创建session 
        }

        vector<vector<float>> detect_landmarks(string image_path);
        vector<vector<float>> detect_image_landmarks(cv::Mat image);

};


#endif