VehicleRearRecg.cpp 953 Bytes
#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;
	params.db_path = dbpath;
	params.engine = ENGINE_TENSORRT;
	params.max_batch = 20;
	params.serialize_file = "./serialize_file/VRR";
	params.auth_license = auth_license;

	int ret = vrr_init(&handle, params);
	if (ret != 0)
	{
		cout << "VRR Init Failed!" << endl;
		return FAILED;
	}

	return SUCCESS;
}
int VehicleRearRecg_Process(void * handle, sy_img * batch_img, int batchsize, vehicle_rear_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;
}