resnet50.h 798 Bytes
Newer Older
liucong's avatar
liucong committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef __CLASSIFIER_H__
#define __CLASSIFIER_H__

#include <string>
#include <migraphx/program.hpp>
#include <opencv2/opencv.hpp>
#include <CommonDefinition.h>

namespace migraphxSamples
{

class  Classifier
{
public:
    Classifier();
    
    ~Classifier();

    ErrorCode Initialize(InitializationParameterOfClassifier initializationParameterOfClassifier);

    ErrorCode Classify(const std::vector<cv::Mat> &srcImages,std::vector<std::vector<ResultOfPrediction>> &predictions);

private:
    cv::FileStorage configurationFile;
    FILE *logFile;
    
    migraphx::program net;
    cv::Size inputSize;
    std::string inputName;
    migraphx::shape inputShape;

    float scale;
    cv::Scalar meanValue;
    bool swapRB;
    bool crop;
    bool useInt8;
    bool useFP16;    

};

}

#endif