Compare commits

..

No commits in common. "721560cf9868a8baed0ebf09dbc81fb3c1277e79" and "05bc4ee667dd22f0a9acc71e2f914a31c598e55d" have entirely different histories.

1 changed files with 1 additions and 5 deletions

6
app.py
View File

@ -122,9 +122,6 @@ 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:
@ -133,8 +130,7 @@ def worker(id,source,region=None,stream=False):
ball = balls.get(name,{})
# ball["tkid"] = int(tracker_id)
ball["conf"] = round(float(confidence), 2)
site = [int(xyxy[0]), int(xyxy[1]), int(xyxy[2]), int(xyxy[3])]
ball["xyxy"].append(site)
ball["xyxy"] = [int(xyxy[0]), int(xyxy[1]), int(xyxy[2]), int(xyxy[3])]
ball["count"] = ball.get("count",0) + 1
if region - count < 3:
ball["final"] = ball.get("final",0) + 1