speakcls.h 942 Bytes
#ifndef SPEAKCLS_H
#define SPEALCLS_H
#include<opencv2/opencv.hpp>
#include<MNN/Interpreter.hpp>
#include<MNN/ImageProcess.hpp>
#include<typeinfo>
using namespace std;
using namespace cv;
using namespace MNN;
class SpeakCls{
    private:
        std::shared_ptr<MNN::Interpreter> net;
        ScheduleConfig config;
    public:
        SpeakCls(){};
        SpeakCls(string model_path){
            
            //"/home/situ/qfs/sdk_project/mnn_demo/cls_speak_v0.2.2.mnn"
            net= std::shared_ptr<MNN::Interpreter>(MNN::Interpreter::createFromFile("/home/situ/qfs/sdk_project/mnn_demo/cls_speak_v0.2.2.mnn"));//创建解释器
            config.numThread = 8;
            config.type = MNN_FORWARD_CPU;

        }

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

};
#endif