Commit 767bb02f849492065240c0cc08e2b3cf2c7c5675
1 parent
97743cec
修正跟踪
Showing
3 changed files
with
10 additions
and
19 deletions
vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.cpp
@@ -251,39 +251,31 @@ int VPTProcess::process(sy_img * batch_img, int batchsize, vector<unsigned long | @@ -251,39 +251,31 @@ int VPTProcess::process(sy_img * batch_img, int batchsize, vector<unsigned long | ||
251 | } | 251 | } |
252 | } | 252 | } |
253 | 253 | ||
254 | - for (int i = 0; i < batchsize; i++){ | ||
255 | - TaskTracker& task_tracker = taskTrackers[i]; | 254 | + for (int i = 0; i < batchsize; i++) { |
255 | + TaskTracker& task_tracker = tools->taskTrackers[i]; | ||
256 | if (!task_tracker.tracker.GetState()) { | 256 | if (!task_tracker.tracker.GetState()) { |
257 | continue; | 257 | continue; |
258 | } | 258 | } |
259 | 259 | ||
260 | - if (task_tracker.lastFrameIndex <= 0) { | ||
261 | - // 第一帧,只做带检测框的跟踪 | ||
262 | - int objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, true, detectResult[i], result[i].obj, deleteObjectID[i]); | ||
263 | - result[i].objCount = objCount; | ||
264 | - } else { | 260 | + if (task_tracker.lastFrameIndex > 0) { |
261 | + // 非第一帧 | ||
265 | int update_times = vec_frameIndex[i] - task_tracker.lastFrameIndex - 1; | 262 | int update_times = vec_frameIndex[i] - task_tracker.lastFrameIndex - 1; |
266 | if (update_times < 0) { | 263 | if (update_times < 0) { |
267 | cout << "FrameIndex error !! lastFrameIndex= " << task_tracker.lastFrameIndex << " cur_frameindex = " << vec_frameIndex[i] << endl; | 264 | cout << "FrameIndex error !! lastFrameIndex= " << task_tracker.lastFrameIndex << " cur_frameindex = " << vec_frameIndex[i] << endl; |
268 | } | 265 | } |
269 | - // cout << "lastFrameIndex= " << task_tracker.lastFrameIndex << " cur_frameindex = " << vec_frameIndex[detectIndex] << endl; | ||
270 | - // cout << "update_times = " << update_times << endl; | ||
271 | 266 | ||
272 | for (int j = 0; j < update_times; j++) { // 无检测框跟踪 | 267 | for (int j = 0; j < update_times; j++) { // 无检测框跟踪 |
273 | - //cout << "taskTrackers size: " << task_tracker.size() << " batchsize:" << detectResult.size() << " update_times: "<< update_times << endl; | ||
274 | - 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); | 268 | + VPT_Result unresult; |
269 | + unresult.objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, false, task_tracker.lastDetectResult, unresult.obj, task_tracker.lastDeleteObjectID); | ||
270 | + check_VPT_Result(unresult); | ||
271 | + unUsedResult[i].push_back(unresult); | ||
275 | } | 272 | } |
276 | - | ||
277 | - //有检测框输入的跟踪 | ||
278 | - int objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, true, detectResult[i], result[i].obj, deleteObjectID[i]); | ||
279 | - result[i].objCount = objCount; | ||
280 | } | 273 | } |
274 | + result[i].objCount = task_tracker.tracker.update(task_tracker.ratioWidth, task_tracker.ratioHeight, true, detectResult[i], result[i].obj, deleteObjectID[i]); | ||
281 | 275 | ||
282 | check_VPT_Result(result[i]); | 276 | check_VPT_Result(result[i]); |
283 | 277 | ||
284 | task_tracker.lastDetectResult = detectResult[i]; | 278 | task_tracker.lastDetectResult = detectResult[i]; |
285 | - task_tracker.lastUnUsedResult.objCount = result[i].objCount; | ||
286 | - memcpy(task_tracker.lastUnUsedResult.obj, result[i].obj, sizeof(VPT_ObjInfo) * MAX_OBJ_COUNT); | ||
287 | task_tracker.lastDeleteObjectID = deleteObjectID[i]; | 279 | task_tracker.lastDeleteObjectID = deleteObjectID[i]; |
288 | 280 | ||
289 | // 记录帧序号 | 281 | // 记录帧序号 |
vehicle_structure_platform.git0708-3080-trt-face/src/VPT/VPTProcess.h
@@ -25,7 +25,6 @@ struct TaskTracker | @@ -25,7 +25,6 @@ struct TaskTracker | ||
25 | unsigned int lastFrameIndex; | 25 | unsigned int lastFrameIndex; |
26 | 26 | ||
27 | vector< vector <float>> lastDetectResult; | 27 | vector< vector <float>> lastDetectResult; |
28 | - VPT_Result lastUnUsedResult; | ||
29 | vector<int> lastDeleteObjectID; | 28 | vector<int> lastDeleteObjectID; |
30 | }; | 29 | }; |
31 | 30 |
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 | @@ -1257,7 +1257,7 @@ void snapshot_helper::VehicleRecog_Process(sy_img * batch_img, int batchsize, vr | ||
1257 | 1257 | ||
1258 | if (index_head != 0) | 1258 | if (index_head != 0) |
1259 | { | 1259 | { |
1260 | - LOG_DEBUG("index_head : {}", index_head); | 1260 | + // LOG_DEBUG("index_head : {}", index_head); |
1261 | vehicle_recog_result *vrresult = new vehicle_recog_result[index_head]{}; | 1261 | vehicle_recog_result *vrresult = new vehicle_recog_result[index_head]{}; |
1262 | m_vehicle_recognition.process(batch_vehicle_head, index_head, vrresult); | 1262 | m_vehicle_recognition.process(batch_vehicle_head, index_head, vrresult); |
1263 | 1263 |