main
luanhailiang 2023-11-07 16:16:15 +08:00
parent ef5b8df9b4
commit bd8f4a7cdd
1 changed files with 3 additions and 3 deletions

6
app.py
View File

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