VehicleRearRecg.cpp 1.26 KB
#include "VehicleRearRecg.h"
using namespace std;
int VehicleRearRecg_Init(void *&handle, char*dbpath, int gpuid, char* auth_license)
{
	vrr_param params;
	params.gpuid = gpuid;
	params.mode = DEVICE_GPU;
 //printf("ERROR PATH\n");
	params.db_path = dbpath;//"../../db/mvpt.bin";
	params.engine = ENGINE_TENSORRT;
	params.max_batch = 20;
	params.serialize_file = "./serialize_file/VRR";
	params.auth_license = auth_license;

	//#ifdef _MSC_VER
	//	params.dbPath = "../../../../vehicleRecognition_MCaffeTmpBody/db/CarBodyFeature.db";
	//#else
	//    params.dbPath = "/home/mliu/project/Project_MultiVPT/Video-Platform/video_structure_20190131/VehicleRecognition_body/db/CarBodyFeature.db";
	//#endif

	int ret = vrr_init(&handle, params);
	if (ret != 0)
	{
		cout << "VRR Init Failed!" << endl;
		system("pause");
		return FAILED;
	}
	return SUCCESS;
}
int VehicleRearRecg_Process(void * handle, sy_img * batch_img, int batchsize, vr_result *&vr_result)
{
	for (int i = 0; i < batchsize; i++)
	{
		if (batch_img[i].data_ == NULL)
			cout << i << " data null" << endl;
	}

	vrr_batch(handle, batch_img, batchsize, vr_result);


	return SUCCESS;
}
int VehicleRearRecg_Release(void *& handle)
{
	if (handle)
	vrr_release(&handle);
	return SUCCESS;
}