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])]