vpt.h 3.68 KB
/*******************************************************************************************
* Version: vpt_det_v0.0.0
* CopyRight: 中科院自动化研究所模式识别实验室图像视频组
* UpdateDate: 20190327
* Content: 人车物检测
********************************************************************************************/

#ifndef VPT_DET_H_
#define VPT_DET_H_

#ifdef _MSC_VER
#ifdef VPT_DET_EXPORTS
#define VPT_DET_API __declspec(dllexport)
#else
#define VPT_DET_API __declspec(dllimport)
#endif
#else
#define VPT_DET_API   __attribute__ ((visibility ("default")))
#endif

#include "sy_common.h"

//extern "C"
//{

#ifndef MAX_BATCH_SIZE
#define MAX_BATCH_SIZE 16
#endif

#define MAX_DET_COUNT 50

	//Utools Obj Results
#ifndef __VPT_OBJ_RESULT__
#define __VPT_OBJ_RESULT__
	typedef struct vpt_obj_result
	{
		int obj_id;					//不开启跟踪时对应batch输入顺序,开启后对应目标的id
		sy_rect obj_rect;					//位置
		int obj_index;
		float obj_score;
	}vpt_obj_result;
#endif

	//Utools Results
#ifndef __VPT_RESULT__
#define __VPT_RESULT__ 
	typedef struct vpt_result
	{
		int obj_count_;		                //返回特征数组总个数 < 检测中:单batch检测总数 / 分类中:Multi数 >
		vpt_obj_result *obj_results_;		//单batch中 所有的结果 batch size <= MAX_BATCH_SIZE
	}vpt_result;
#endif //by Junlin 190121

#ifndef __VPT_PARAM__
#define __VPT_PARAM__
	typedef struct vpt_param
	{
		// int mode;				//运行模式(DEVICE_GPU / DEVICE_CPU)
		int devId;              //ָ指定显卡id
		char* modelNames;
		// char* modelNames_b10;
        float threshold;
		bool isTrk;             //是否开启跟踪
		//vpt_param() :mode(DEVICE_GPU), gpuid(0), threshold(0.6) {};
	}vpt_param;
#endif

	/*************************************************************************
	* FUNCTION: hcp_init
	* PURPOSE: 初始化
	* PARAM:
	[out] tools		   - 句柄
	[in]  param    - 初始化参数
	* RETURN:
	[out] int             - 初始化是否成功(SUCCEEDED表示成功,FAILED表示失败)
	* NOTES:
	*************************************************************************/
	VPT_DET_API int vpt_init(void **handle, vpt_param param);

	/*************************************************************************
	* FUNCTION: hcp_process
	* PURPOSE: 人骑车属性检测
	* PARAM:
	[in] tools		      - 句柄
	[in] img_data          - 检测图像数据
	[in] width            - 检测图像宽度
	[in] height           - 检测图像高度
	[in] channels         - 检测图像通道数
	[in] result           - 检测结果
	* RETURN:
	[out] int             - 检测是否成功(SUCCEEDED表示成功,FAILED表示失败)
	* NOTES:
	*************************************************************************/
	// VPT_DET_API int vpt_process(void * handle, sy_img img, vpt_result *result);


	// VPT_DET_API int vpt_batch(void * handle, sy_img *batch_img, int batchsize, vpt_result **result);
	VPT_DET_API int vpt_batch(void * handle, sy_img *batch_img, int batchsize, vpt_result *result);

	// VPT_DET_API int vpt_batch10(void * handle, sy_img *batch_img, int batchsize, vpt_result **result);

	/*************************************************************************
	* FUNCTION: hcp_release
	* PURPOSE: 资源释放
	* PARAM:
	[in] tools		    - 处理句柄
	* RETURN:	NULL
	* NOTES:
	*************************************************************************/
	VPT_DET_API void vpt_release(void **handle);


	/*************************************************************************
	* FUNCTION: hcp_get_version
	* PURPOSE:
	* PARAM:	NULL
	* RETURN:	版本号
	* NOTES:
	*************************************************************************/
	VPT_DET_API const char * vpt_get_version();
//}
#endif