/************************************************************************* * Version: humanreid_v0.0.0 * CopyRight : * UpdateDate:20220322 * 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