motor_rainshed_cls.h
3.27 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*************************************************************************
* Version: motor_rainshed_cls_v0.0.0.20230921
* CopyRight : 中国科学院自动化所模式识别实验室图像视频组
* UpdateDate:20230921
* Content : 二轮车是否加装雨棚
*************************************************************************/
#ifndef MOTORRAINCLS_H_
#define MOTORRAINCLS_H_
#if _MSC_VER
#ifdef MOTORRAINCLS_EXPORTS
#define MOTORRAINCLS_API __declspec(dllexport)
#else
#define MOTORRAINCLS_API __declspec(dllimport)
#endif
#else
#define MOTORRAINCLS_API __attribute__ ((visibility ("default")))
#endif
#include "sy_common.h"
#ifndef MAX_BATCH_SIZE
#define MAX_BATCH_SIZE 16
#endif
#ifdef __cplusplus
extern "C"
{
#endif
//分类结果
#ifndef MRCRESULT_
#define MRCRESULT_
typedef struct mrc_result
{
float score;
int index;
}mrc_result;
#endif
#ifndef __MRCPARAM__
#define __MRCPARAM__
typedef struct mrc_param
{
int devId; //ָ指定显卡id
char* modelNames;
char* modelNames_b;
float thresld; //阈值
int max_batch;
mrc_param() :devId(0), max_batch(8), thresld(0.0), modelNames(nullptr), modelNames_b(nullptr) {};
}mrc_param;
#endif
/*************************************************************************
* FUNCTION: mrc_init
* PURPOSE: 载入模型
* PARAM:
[in] handle - 句柄
[in] params - 参数
* RETURN: 成功(0)或者错误代码
* NOTES:
*************************************************************************/
MOTORRAINCLS_API int mrc_init(void ** handle, mrc_param param);
/*************************************************************************
* FUNCTION: mrc_process
* PURPOSE: 二轮车加装雨棚分类
* PARAM:
[in] handle - 检测句柄
[in] img_data - 图像数据
[in] result - 结果 内存在外部申请
* RETURN: 成功(0) 或 错误代码(< 0)
* NOTES:
*************************************************************************/
MOTORRAINCLS_API int mrc_process(void *handle, sy_img img_data, mrc_result * result);
/*************************************************************************
* FUNCTION: mrc_batch
* PURPOSE: 二轮车加装雨棚分类 batch
* PARAM:
[in] handle - 检测句柄
[in] img_data_array - 图像数据
[in] batch_size - 图像数目
[in] result - 结果 内存在外部申请
* RETURN: 成功(0) 或 错误代码(< 0)
* NOTES:
*************************************************************************/
MOTORRAINCLS_API int mrc_batch(void *handle, sy_img* img_data_array, int batch_size, mrc_result * result);
MOTORRAINCLS_API int mrc_batchV2(void *handle, sy_img* img_data_array, int batch_size, mrc_result * result);
/*************************************************************************
* FUNCTION: mrc_release
* PURPOSE: 释放
* PARAM:
[in] handle - handle
* RETURN: NULL
* NOTES:
*************************************************************************/
MOTORRAINCLS_API void mrc_release(void ** handle);
/*************************************************************************
* FUNCTION: mrc_get_version
* PURPOSE:
* PARAM: NULL
* RETURN: 版本号
* NOTES:
*************************************************************************/
MOTORRAINCLS_API const char * mrc_get_version();
#ifdef __cplusplus
};
#endif
#endif