CommonDefinition.h 1.2 KB
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

#ifndef __COMMON_DEFINITION_H__
#define __COMMON_DEFINITION_H__

#include <opencv2/opencv.hpp>

namespace migraphxSamples
{
   
// 路径分隔符(Linux:‘/’,Windows:’\\’)
#ifdef _WIN32
#define  PATH_SEPARATOR '\\'
#else
#define  PATH_SEPARATOR '/'
#endif

#define CONFIG_FILE                                                     "../Resource/Configuration.xml"

liucong's avatar
liucong committed
20
typedef enum _ErrorCode
21
22
23
24
25
26
27
28
29
{
    SUCCESS=0,  // 0
    MODEL_NOT_EXIST, // 模型不存在
    CONFIG_FILE_NOT_EXIST, // 配置文件不存在
    FAIL_TO_LOAD_MODEL, // 加载模型失败
    FAIL_TO_OPEN_CONFIG_FILE, // 加载配置文件失败
    IMAGE_ERROR, // 图像错误
}ErrorCode;

liucong's avatar
liucong committed
30
typedef struct _ResultOfPrediction
31
32
33
34
35
36
37
{
    float confidence;
    int label;
    _ResultOfPrediction():confidence(0.0f),label(0){}

}ResultOfPrediction;

liucong's avatar
liucong committed
38
typedef struct _ResultOfDetection
39
{
liucong's avatar
liucong committed
40
    cv::Rect boundingBox;
41
42
    float confidence;
    int classID;
liucong's avatar
liucong committed
43
    std::string className;
44
45
46
47
48
49
    bool exist;

    _ResultOfDetection():confidence(0.0f),classID(0),exist(true){}

}ResultOfDetection;

liucong's avatar
liucong committed
50
typedef struct _InitializationParameterOfSegmentation
51
52
53
54
55
56
57
58
59
{
    std::string parentPath;
    std::string configFilePath;
}InitializationParameterOfSegmentation;

}

#endif