#include "vehicle_recognition.h" #include #include "sy_errorinfo.h" #include "vehicle_features.h" using namespace std; int VehicleRecognition_Init(void *&handle, char*dbpath, int gpuid, char* auth_license) { vr_param params; params.gpuid = 0; params.mode = DEVICE_GPU; params.engine = ENGINE_TENSORRT; params.max_batch = 20; params.vehicle_brand_serialize_file = "./serialize_file/VEHICLE_BRAND"; params.vr5905cls_serialize_file = "./serialize_file/VR5905CLS"; params.vehicle_type_serialize_file = "./serialize_file/VEHICLE_TYPE"; params.auth_license = "sy_va_sub_sdk_2023"; int ret = vr_init(&handle, params); if (ret != 0) { cout << "VR Init Failed!" << endl; return FAILED; } return SUCCESS; } int VehicleRecognition_Process(void * handle, sy_img * batch_img, int batchsize, vehicle_recog_result *&vrresult) { for (int i = 0; i < batchsize; i++) { if (batch_img[i].data_ == NULL) cout << i << " data null" << endl; } vr_batch(handle, batch_img, batchsize, vrresult); return SUCCESS; } int VehicleRecognition_Release(void *& handle) { if (handle) vr_release(&handle); return SUCCESS; }