Blame view

src/VPT/snapshot_analysis/VehicleRearRecg.cpp 1.11 KB
e30d6793   Zou XiKun   v0.0.1
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
  #include "VehicleRearRecg.h"
  using namespace std;
  int VehicleRearRecg_Init(void *&handle, char*dbpath, int gpuid)
  {
  	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";
  	//#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;
  }