speakcls.h 712 Bytes
#ifndef SPEAKCLS_H
#define SPEALCLS_H
#include<opencv2/opencv.hpp>
#include<MNN/Interpreter.hpp>
#include<MNN/ImageProcess.hpp>
#include<memory>
using namespace std;
using namespace cv;
using namespace MNN;
class SpeakCls{
    private:
        std::shared_ptr<MNN::Interpreter> net;
        MNN::Session* session;
        MNN::Tensor* input_tensor;
        ScheduleConfig config;
        int split_nums = 10;
        
    public:
        SpeakCls(){};
        bool init_model(string model_path);
        bool inference(vector<Mat> images);

    private:
        cv::Mat standardize(cv::Mat image);
        cv::Mat data_process(vector<Mat> images);
        vector<double> softmax(vector<double> input);

};
#endif