From 49f38b09ab861bb8a152496f488d54ba70c09e87 Mon Sep 17 00:00:00 2001 From: th Date: Sat, 26 Jul 2025 10:06:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=BA=E7=BE=A4=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E4=BA=BA=E6=95=B0=E6=98=BE=E7=A4=BA=E5=8F=8A=E8=BE=B9?= =?UTF-8?q?=E7=95=8C=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AI.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/AI.py b/AI.py index 6ed26ba..257350d 100644 --- a/AI.py +++ b/AI.py @@ -764,10 +764,10 @@ def AI_process_Crowd(im0s,model,device,postPar): if P == 0: time_info = 'No Valid object find' return [im0s[0], im0s[0], dets, 0], time_info - x1 = detP[:, 0] - 5 - y1 = detP[:, 1] - 5 - x2 = detP[:, 0] + 5 - y2 = detP[:, 1] + 5 + x1 = detP[:, 0] - p_postPar['expend'] + y1 = detP[:, 1] - p_postPar['expend'] + x2 = detP[:, 0] + p_postPar['expend'] + y2 = detP[:, 1] + p_postPar['expend'] detP = np.column_stack((x1, y1, x2, y2)) detM = detM[:,:4] a_x1, a_y1, a_x2, a_y2 = detM[:, 0], detM[:, 1], detM[:, 2], detM[:, 3] @@ -800,12 +800,11 @@ def AI_process_Crowd(im0s,model,device,postPar): if len(p_indices) > 0: detP = detP[p_indices] detP = detP[:, :2] - detP[:, 0] = detP[:, 0] + 5 - detP[:, 1] = detP[:, 1] + 5 - - dets= [[detM.tolist(), detP.tolist()]] + detP[:, 0] = detP[:, 0] + p_postPar['expend'] + detP[:, 1] = detP[:, 1] + p_postPar['expend'] + dets= [[detM.tolist(), detP.tolist(),p_postPar['psize']]] else: - dets = [[detP.tolist()]] + dets = [[detP.tolist(),p_postPar['psize']]] # for b in detM: # b_label = '该建筑物下行人及数量:%d'%(int(b[4]))