From bd8f4a7cddfaef16c0de8a44987afd8db004ab6b Mon Sep 17 00:00:00 2001 From: luanhailiang Date: Tue, 7 Nov 2023 16:16:15 +0800 Subject: [PATCH] ball --- app.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 758ba93..a28a87b 100644 --- a/app.py +++ b/app.py @@ -122,15 +122,15 @@ def worker(id,source,region=None,stream=False): count += 1 names = {} - # 检查 "xyxy" 键是否为 None - if ball.get("xyxy") is None: - ball["xyxy"] = [] for xyxy,_, confidence, class_id,tracker_id in detections: name = model.model.names[class_id] if name in names: print("Name duplicate",name) continue ball = balls.get(name,{}) + # 检查 "xyxy" 键是否为 None + if ball.get("xyxy") is None: + ball["xyxy"] = [] # ball["tkid"] = int(tracker_id) ball["conf"] = round(float(confidence), 2) site = [int(xyxy[0]), int(xyxy[1]), int(xyxy[2]), int(xyxy[3])]