Blame view

src/ai_engine_module/humanreid.h 2.63 KB
6fdcb6a5   Hu Chunming   初次提交,代码大体完成编写,完善中
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
  /*************************************************************************

  * Version: humanreid_v0.0.0

  * CopyRight : 

  * UpdateDate20220322

  * Content : 行人再识别

  *************************************************************************/

  #ifndef HUMANREID_H_

  #define HUMANREID_H_

  

  #if _MSC_VER

  #ifdef HUMANREID_EXPORTS

  #define HUMANREID_API __declspec(dllexport)

  #else

  #define HUMANREID_API __declspec(dllimport)

  #endif

  #else

  #define HUMANREID_API __attribute__ ((visibility ("default")))

  #endif

  

  #include "sy_common.h"

  #define HUMANREID_FEATURESIZE 384		//特征长度

  

  

  

  

  #ifdef __cplusplus

  extern "C"

  {

  #endif

  

  

  #ifndef __HUMANREID_PARAM__

  #define __HUMANREID_PARAM__

  	typedef struct humanreid_param

  	{

  		int devId;		//指定NPU卡号

  		char* modelNames;

  		

  		// int engine;  //指定运行引擎 (ENGINE_MCAFFE2 / ENGINE_TENSORRT)

  		// int max_batch; //指定trt框架最大batch

  		// char* serialize_file;

  		humanreid_param() :devId(0) {};

  	}humanreid_param;

  #endif

  

  	/*************************************************************************

  	* FUNCTION: humanreid_init

  	* PURPOSE: 载入模型

  	* PARAM:

  	[in] handle			- 句柄

  	[in] params			- 参数

  	* RETURN:	成功(0)或者错误代码

  	* NOTES:

  	*************************************************************************/

  	HUMANREID_API int humanreid_init(void ** handle, humanreid_param param);

  

  

  	/*************************************************************************

  	* FUNCTION: humanreid_batch

  	* PURPOSE: 行人再识别 batch  ---模型暂时只支持batchsize=1

  	* PARAM:

  	[in] handle			- 检测句柄

  	[in] img_data_array	- 图像数据

  	[in] batch_size		- 图像数目

  	[in] result			- 结果 内存在外部申请

  	* RETURN:	成功(0)  错误代码(< 0

  	* NOTES:

  	*************************************************************************/

  	HUMANREID_API int humanreid_batch(void *handle, sy_img* img_data_array, int batch_size,  float ** fea);

  

  

  	/*************************************************************************

  	* FUNCTION: humanreid_release

  	* PURPOSE: 释放

  	* PARAM:

  	[in] handle			- handle

  	* RETURN:	NULL

  	* NOTES:

  	*************************************************************************/

  	HUMANREID_API void humanreid_release(void ** handle);

  

  

  	/*************************************************************************

  	* FUNCTION: humanreid_get_version

  	* PURPOSE:

  	* PARAM:	NULL

  	* RETURN:	版本号

  	* NOTES:

  	*************************************************************************/

  	HUMANREID_API const char * humanreid_get_version();

  

  #ifdef __cplusplus

  };

  #endif

  

  #endif