diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.cpp b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.cpp index 3b071c1..2fe4800 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.cpp +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.cpp @@ -251,39 +251,31 @@ int VPTProcess::process(sy_img * batch_img, int batchsize, vectortaskTrackers[i]; if (!task_tracker.tracker.GetState()) { continue; } - if (task_tracker.lastFrameIndex <= 0) { - // 第一帧,只做带检测框的跟踪 - int objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, true, detectResult[i], result[i].obj, deleteObjectID[i]); - result[i].objCount = objCount; - } else { + if (task_tracker.lastFrameIndex > 0) { + // 非第一帧 int update_times = vec_frameIndex[i] - task_tracker.lastFrameIndex - 1; if (update_times < 0) { cout << "FrameIndex error !! lastFrameIndex= " << task_tracker.lastFrameIndex << " cur_frameindex = " << vec_frameIndex[i] << endl; } - // cout << "lastFrameIndex= " << task_tracker.lastFrameIndex << " cur_frameindex = " << vec_frameIndex[detectIndex] << endl; - // cout << "update_times = " << update_times << endl; for (int j = 0; j < update_times; j++) { // 无检测框跟踪 - //cout << "taskTrackers size: " << task_tracker.size() << " batchsize:" << detectResult.size() << " update_times: "<< update_times << endl; - task_tracker.lastUnUsedResult.objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, false, task_tracker.lastDetectResult, task_tracker.lastUnUsedResult.obj, task_tracker.lastDeleteObjectID); + VPT_Result unresult; + unresult.objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, false, task_tracker.lastDetectResult, unresult.obj, task_tracker.lastDeleteObjectID); + check_VPT_Result(unresult); + unUsedResult[i].push_back(unresult); } - - //有检测框输入的跟踪 - int objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, true, detectResult[i], result[i].obj, deleteObjectID[i]); - result[i].objCount = objCount; } + result[i].objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, true, detectResult[i], result[i].obj, deleteObjectID[i]); check_VPT_Result(result[i]); task_tracker.lastDetectResult = detectResult[i]; - task_tracker.lastUnUsedResult.objCount = result[i].objCount; - memcpy(task_tracker.lastUnUsedResult.obj, result[i].obj, sizeof(VPT_ObjInfo) * MAX_OBJ_COUNT); task_tracker.lastDeleteObjectID = deleteObjectID[i]; // 记录帧序号 diff --git a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.h b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.h index 2c17336..fb74e3b 100644 --- a/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.h +++ b/vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.h @@ -25,7 +25,6 @@ struct TaskTracker unsigned int lastFrameIndex; vector< vector > lastDetectResult; - VPT_Result lastUnUsedResult; vector lastDeleteObjectID; }; 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 331421a..657e9fd 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 @@ -1257,7 +1257,7 @@ void snapshot_helper::VehicleRecog_Process(sy_img * batch_img, int batchsize, vr if (index_head != 0) { - LOG_DEBUG("index_head : {}", index_head); + // LOG_DEBUG("index_head : {}", index_head); vehicle_recog_result *vrresult = new vehicle_recog_result[index_head]{}; m_vehicle_recognition.process(batch_vehicle_head, index_head, vrresult);