ball
parent
ef5b8df9b4
commit
bd8f4a7cdd
6
app.py
6
app.py
|
@ -122,15 +122,15 @@ def worker(id,source,region=None,stream=False):
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
names = {}
|
names = {}
|
||||||
# 检查 "xyxy" 键是否为 None
|
|
||||||
if ball.get("xyxy") is None:
|
|
||||||
ball["xyxy"] = []
|
|
||||||
for xyxy,_, confidence, class_id,tracker_id in detections:
|
for xyxy,_, confidence, class_id,tracker_id in detections:
|
||||||
name = model.model.names[class_id]
|
name = model.model.names[class_id]
|
||||||
if name in names:
|
if name in names:
|
||||||
print("Name duplicate",name)
|
print("Name duplicate",name)
|
||||||
continue
|
continue
|
||||||
ball = balls.get(name,{})
|
ball = balls.get(name,{})
|
||||||
|
# 检查 "xyxy" 键是否为 None
|
||||||
|
if ball.get("xyxy") is None:
|
||||||
|
ball["xyxy"] = []
|
||||||
# ball["tkid"] = int(tracker_id)
|
# ball["tkid"] = int(tracker_id)
|
||||||
ball["conf"] = round(float(confidence), 2)
|
ball["conf"] = round(float(confidence), 2)
|
||||||
site = [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])]
|
||||||
|
|
Loading…
Reference in New Issue