diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/MutliSourceVideoProcess.cpp b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/MutliSourceVideoProcess.cpp index 428aaff..3cfe677 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/MutliSourceVideoProcess.cpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/MutliSourceVideoProcess.cpp @@ -361,7 +361,7 @@ void CMutliSourceVideoProcess::FinishTask(const int taskID) tasks[i].taskObjCallbackFunc = nullptr; tasks[i].taskRealTimeCallbackFunc = nullptr; - m_snaphot_helper.finish_task_ss_analysis(taskID, m_hp_analysis_config, m_hcp_analysis_config, m_vehicle_analysis_config, m_hf_recg_config, m_hcf_recg_config, m_vcf_recg_config); + m_snaphot_helper.finish_task_ss_analysis(taskID); if (tasks[i].folderName) { diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp index f07c029..a219161 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.cpp @@ -112,35 +112,35 @@ void snapshot_helper::snapshot_helper_init(int gpuid, double gpu_total_memory, c this->wait_framecount = wait_framecount; - if (hp_analysis_config == SY_CONFIG_OPEN || hf_recg_config == SY_CONFIG_OPEN) + if (hp_analysis_cf == SY_CONFIG_OPEN || hf_recg_cf == SY_CONFIG_OPEN) { HumanParsing_Init(hp_handle, gpuid, auth_license); } - if (hcp_analysis_config == SY_CONFIG_OPEN || hcf_recg_config == SY_CONFIG_OPEN) + if (hcp_analysis_cf == SY_CONFIG_OPEN || hcf_recg_cf == SY_CONFIG_OPEN) { m_human_car_parsing.init(gpuid, auth_license); } - if (hf_recg_config == SY_CONFIG_OPEN || hcf_recg_config == SY_CONFIG_OPEN) + if (hf_recg_cf == SY_CONFIG_OPEN || hcf_recg_cf == SY_CONFIG_OPEN) { NonVehicleFea_Init(nvf_handle, gpuid, auth_license); } - if (vehicle_analysis_config == SY_CONFIG_OPEN) + if (vehicle_analysis_cf == SY_CONFIG_OPEN) { VehicleColor_Init(vc_handle, gpuid, auth_license); VehiclePlateDetectRecog_Init(vp_handle, gpuid, auth_license); VehicleRecognition_Init(vr_handle, dbpath_utf8, gpuid, auth_license); VehicleRearRecg_Init(vrr_handle, dbpath, gpuid, auth_license); } - if (vehicle_analysis_config == SY_CONFIG_OPEN || vcf_recg_config == SY_CONFIG_OPEN) + if (vehicle_analysis_cf == SY_CONFIG_OPEN || vcf_recg_cf == SY_CONFIG_OPEN) { vhd_features_init(vhd_handle, dbpath_utf8, gpuid, auth_license); } - if (vcf_recg_config == SY_CONFIG_OPEN) + if (vcf_recg_cf == SY_CONFIG_OPEN) { vf_features_init(vf_handle, dbpath_utf8, gpuid, auth_license); } @@ -461,7 +461,7 @@ void snapshot_helper::object_attri_analysis() //二次属性分析接口 } } -void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysis_config, sy_command hcp_analysis_config, sy_command vehicle_analysis_config, sy_command hf_recg_config, sy_command hcf_recg_config, sy_command vcf_recg_config) //是否开启车辆特征识别); //某一路任务结束了,立马对该路任务进行二次属性分析 +void snapshot_helper::finish_task_ss_analysis(int task_id) //是否开启车辆特征识别); //某一路任务结束了,立马对该路任务进行二次属性分析 { LOG_INFO("in: {}", task_id); @@ -474,13 +474,13 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi { if (iter->first.videoID == task_id) { - if (iter->second.index.index == 0 && (hp_analysis_config == SY_CONFIG_OPEN || hf_recg_config == SY_CONFIG_OPEN) && m_task_info[task_id].snapshot_folder != NULL + if (iter->second.index.index == 0 && (hp_analysis_cf == SY_CONFIG_OPEN || hf_recg_cf == SY_CONFIG_OPEN) && m_task_info[task_id].snapshot_folder != NULL && iter->second.snapShotLittle.frame != NULL && iter->second.snapShotLittle.height == HP_HEIGHT && iter->second.snapShotLittle.width == HP_WIDTH) hp_keys.push_back(iter->first); - else if ((iter->second.index.index == 1 || iter->second.index.index == 2) && (hcp_analysis_config == SY_CONFIG_OPEN || hcf_recg_config == SY_CONFIG_OPEN) && m_task_info[task_id].snapshot_folder != NULL + else if ((iter->second.index.index == 1 || iter->second.index.index == 2) && (hcp_analysis_cf == SY_CONFIG_OPEN || hcf_recg_cf == SY_CONFIG_OPEN) && m_task_info[task_id].snapshot_folder != NULL && iter->second.snapShotLittle.frame != NULL && iter->second.snapShotLittle.height == HCP_HEIGHT && iter->second.snapShotLittle.width == HCP_WIDTH) hcp_keys.push_back(iter->first); - else if ((iter->second.index.index == 8 || (iter->second.index.index >= 4 && iter->second.index.index <= 6)) && (vehicle_analysis_config == SY_CONFIG_OPEN || vcf_recg_config == SY_CONFIG_OPEN) && m_task_info[task_id].snapshot_folder != NULL + else if ((iter->second.index.index == 8 || (iter->second.index.index >= 4 && iter->second.index.index <= 6)) && (vehicle_analysis_cf == SY_CONFIG_OPEN || vcf_recg_cf == SY_CONFIG_OPEN) && m_task_info[task_id].snapshot_folder != NULL && iter->second.snapShotLittle.frame != NULL && iter->second.snapShotLittle.height == VEHICLE_HEIGHT && iter->second.snapShotLittle.width == VEHICLE_WIDTH) vehicle_keys.push(iter->first); else @@ -512,14 +512,14 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi OBJ_KEY cur_obj_key = hp_keys[j]; finish_hp_img[j].set_data(HP_WIDTH, HP_HEIGHT, IMG_CHANNELS, (unsigned char*)snapShotInfo[cur_obj_key].snapShotLittle.frame); } - if (hp_analysis_config == SY_CONFIG_OPEN) + if (hp_analysis_cf == SY_CONFIG_OPEN) { result = new hp_analysis_res[hp_batch_count]{}; //TimeCounting t("HumanParsing_Process"); HumanParsing_Process(hp_handle, finish_hp_img, hp_batch_count, result); } - if (hf_recg_config == SY_CONFIG_OPEN) + if (hf_recg_cf == SY_CONFIG_OPEN) { result_f = new human_fea_result[hp_batch_count]{}; @@ -536,10 +536,10 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi else { hp_result curRes = {}; - if (hp_analysis_config == SY_CONFIG_OPEN) + if (hp_analysis_cf == SY_CONFIG_OPEN) memcpy(curRes.res_objs.res_objs, result[resIndex].res_objs, sizeof(classify_obj_res)* HP_FIR_INDEX_SIZE); - if (hf_recg_config == SY_CONFIG_OPEN) + if (hf_recg_cf == SY_CONFIG_OPEN) memcpy(curRes.feature, result_f[resIndex].human_fea, sizeof(int8)* HF_FEA_SIZE); snapshot_res_callback(hp_keys[k], &curRes); @@ -616,7 +616,7 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi finish_hcp_img[j].set_data(HCP_WIDTH, HCP_HEIGHT, IMG_CHANNELS, (unsigned char*)snapShotInfo[cur_obj_key].snapShotLittle.frame); } - if (hcp_analysis_config == SY_CONFIG_OPEN) { + if (hcp_analysis_cf == SY_CONFIG_OPEN) { result = new hcp_analysis_result[hcp_batch_count]{}; m_human_car_parsing.process(finish_hcp_img, hcp_batch_count, result); } @@ -638,10 +638,10 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi else { hcp_result curRes = {}; - if (hcp_analysis_config == SY_CONFIG_OPEN) + if (hcp_analysis_cf == SY_CONFIG_OPEN) memcpy(curRes.res_objs.res_objs, result[resIndex].res_objs, sizeof(classify_obj_res)* HCP_FIR_INDEX_SIZE); - if (hcf_recg_config == SY_CONFIG_OPEN) + if (hcf_recg_cf == SY_CONFIG_OPEN) memcpy(curRes.feature, result_f[resIndex].human_fea, sizeof(int8)* HCF_FEA_SIZE); snapshot_res_callback(hcp_keys[k], &curRes); @@ -719,7 +719,7 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi vc_result *vcresult = new vc_result[det_batch_size]{}; vehicle_plate_result *vp_result = new vehicle_plate_result[det_batch_size]{}; vr_result *vrresult = new vr_result[det_batch_size]{}; - if (vehicle_analysis_config == SY_CONFIG_OPEN) { + if (vehicle_analysis_cf == SY_CONFIG_OPEN) { if(det_batch_size == 3) { printf("batchsize: %d \n", det_batch_size); } @@ -729,7 +729,7 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi } int8 ** fea = nullptr; - if (vcf_recg_config == SY_CONFIG_OPEN) { + if (vcf_recg_cf == SY_CONFIG_OPEN) { fea = new int8*[det_batch_size] {}; for (int ii = 0; ii < det_batch_size; ++ii) { fea[ii] = new int8[FEATURESIZE]{}; @@ -744,13 +744,13 @@ void snapshot_helper::finish_task_ss_analysis(int task_id, sy_command hp_analysi auto iter = snapShotInfo.find(det_vehicle_keys[vc_idx]); if (iter != snapShotInfo.end()) { vehicle_result curRes = {}; - if (vehicle_analysis_config == SY_CONFIG_OPEN) { + if (vehicle_analysis_cf == SY_CONFIG_OPEN) { memcpy(&curRes.vc_res, &vcresult[vc_idx], sizeof(vc_result)); memcpy(&curRes.vp_res, &vp_result[vc_idx], sizeof(vehicle_plate_result)); memcpy(&curRes.vr_res, &vrresult[vc_idx], sizeof(vr_result)); } - if (vcf_recg_config == SY_CONFIG_OPEN) { + if (vcf_recg_cf == SY_CONFIG_OPEN) { int8 * feaRes = fea[vc_idx]; memcpy(curRes.feature, feaRes, FEATURESIZE * sizeof(int8)); } @@ -2043,6 +2043,7 @@ int snapshot_helper::SaveResultInFile(const OBJ_KEY & obj_key, const OBJ_VALUE & { if (hcp_analysis_cf == SY_CONFIG_OPEN || hcf_recg_cf == SY_CONFIG_OPEN) { + LOG_DEBUG("({}, {})", obj_key.videoID, obj_key.objID); save_snapshot(obj_key); hcp_analysis(obj_key); } diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h index 8e4abe0..cdc40bf 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/snapshot_analysis/snapshot_helper.h @@ -172,7 +172,7 @@ public: bool vehicle_recg_analysis(); bool vehicle_plate_dr_analysis(); - void finish_task_ss_analysis(int task_id, sy_command hp_analysis_config, sy_command hcp_analysis_config, sy_command vehicle_analysis_config, sy_command hf_recg_config, sy_command hcf_recg_config, sy_command vcf_recg_config); + void finish_task_ss_analysis(int task_id); void object_attri_analysis(); void snapshot_res_callback(OBJ_KEY obj_key,/* OBJ_VALUE obj_value,*/ void* analysisRes = NULL);