Compare commits
2 Commits
05bc4ee667
...
721560cf98
Author | SHA1 | Date |
---|---|---|
|
721560cf98 | |
|
a35167bf8a |
6
app.py
6
app.py
|
@ -122,6 +122,9 @@ 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:
|
||||
|
@ -130,7 +133,8 @@ def worker(id,source,region=None,stream=False):
|
|||
ball = balls.get(name,{})
|
||||
# ball["tkid"] = int(tracker_id)
|
||||
ball["conf"] = round(float(confidence), 2)
|
||||
ball["xyxy"] = [int(xyxy[0]), int(xyxy[1]), int(xyxy[2]), int(xyxy[3])]
|
||||
site = [int(xyxy[0]), int(xyxy[1]), int(xyxy[2]), int(xyxy[3])]
|
||||
ball["xyxy"].append(site)
|
||||
ball["count"] = ball.get("count",0) + 1
|
||||
if region - count < 3:
|
||||
ball["final"] = ball.get("final",0) + 1
|
||||
|
|
Loading…
Reference in New Issue