main
luanhailiang 2023-08-17 13:08:17 +08:00
parent f66dc12d5e
commit 2763f9bafc
1 changed files with 2 additions and 1 deletions

3
app.py
View File

@ -73,6 +73,7 @@ def worker(id,source,region=None,stream=False):
name = model.model.names[class_id]
if name in names:
print("Name duplicate",name)
continue
ball = balls.get(name,{})
ball["tkid"] = int(tracker_id)
ball["conf"] = round(float(confidence), 2)
@ -82,12 +83,12 @@ def worker(id,source,region=None,stream=False):
ball["final"] = ball.get("final",0) + 1
balls[name] = ball
names[name] = True
names = {}
if count < region:
continue
json_data = json.dumps({"table":id,"balls":balls,"time":int(time.time()*1000)})
balls = {}
count = 0
names = {}
if not stream:
yield json_data
else: