human_parsing.h
4.01 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
122
123
124
125
126
127
128
129
130
/*******************************************************************************************
* Version: human_parsing_v0.0.0.190402
* CopyRight: 中科视语(北京)科技有限公司
* UpdateDate: 20190402
* Content: 行人分析
********************************************************************************************/
#ifndef HUMANPARSING_H_
#define HUMANPARSING_H_
#ifdef _MSC_VER
#ifdef HUMANPARSING_EXPORTS
#define HUMANPARSING_API __declspec(dllexport)
#else
#define HUMANPARSING_API __declspec(dllimport)
#endif
#else
#define HUMANPARSING_API __attribute__ ((visibility ("default")))
#endif
#include "sy_common.h"
#ifdef __cplusplus
extern "C"
{
#endif
#ifndef __CLASSIFY_OBJ_RESULT__
#define __CLASSIFY_OBJ_RESULT__
typedef struct classify_obj_res //分类结果结构体
{
int res_index; //分类结果
float res_prob; //分类结构体
classify_obj_res() : res_index(0), res_prob(0) {};
} classify_obj_res;
#endif
#ifndef __HF_FEA_RESULT__
#define __HF_FEA_RESULT__
const int HF_FEATURE_SIZE = 576;
#endif
#ifndef __HP_RESULT__
#define __HP_RESULT__
const int HP_ATTRI_INDEX_SIZE = 16;
typedef struct hp_analysis_res
{
classify_obj_res res_objs[HP_ATTRI_INDEX_SIZE]; //分类结果
float feature[HF_FEATURE_SIZE]; //行人特征
} hp_analysis_res;
#endif
#ifndef __HP_PARAM__
#define __HP_PARAM__
typedef struct hp_param
{
int devId; //ָ指定显卡id
char* modelNames; //模型路径
// int engine; //指定运行引擎(ENGINE_MCAFFE2 / ENGINE_TENSORRT)
// int max_batch; //指定trt最大batch数
// char* serialize_file;
// char* auth_license;
// hp_param() :mode(DEVICE_GPU), gpuid(0) {};
}hp_param;
#endif
/*************************************************************************
* FUNCTION: hp_init
* PURPOSE: 初始化
* PARAM:
[out] handle - 句柄
[in] hp_param - 初始化参数
* RETURN:
[out] int - 初始化是否成功(SUCCEEDED表示成功,FAILED表示失败)
* NOTES:
*************************************************************************/
HUMANPARSING_API int hp_init(void ** handle, hp_param param);
/*************************************************************************
* FUNCTION: hp_process
* PURPOSE: 行人属性检测
* PARAM:
[in] tools - 句柄
[in] img_data - 检测图像数据
[in] result - 检测结果
* RETURN:
[out] int - 检测是否成功(SUCCEED表示成功,FAILED表示失败)
* NOTES:
*************************************************************************/
HUMANPARSING_API int hp_process(void * handle, sy_img img_data, hp_analysis_res * result);
/*************************************************************************
* FUNCTION: hp_batch
* PURPOSE: 行人属性检测 batch
* PARAM:
[in] tools - 句柄
[in] img_data_array - 检测图像数据
[in] batch_size - 检测图像数目
[in] result - 检测结果
* RETURN:
[out] int - 检测是否成功(SUCCEED表示成功,FAILED表示失败)
* NOTES:
*************************************************************************/
HUMANPARSING_API int hp_batch(void * handle, sy_img *img_data_array, int batch_size, hp_analysis_res * result);
/*************************************************************************
* FUNCTION: hp_release
* PURPOSE: 资源释放
* PARAM:
[in] handle - 处理句柄
* RETURN: NULL
* NOTES:
*************************************************************************/
HUMANPARSING_API void hp_release(void ** handle);
/*************************************************************************
* FUNCTION: vc_get_version
* PURPOSE:
* PARAM: NULL
* RETURN: 版本号
* NOTES:
*************************************************************************/
HUMANPARSING_API const char * hp_get_version();
#ifdef __cplusplus
};
#endif
#endif