diff --git a/app.py b/app.py index 4ef718c..abdc605 100644 --- a/app.py +++ b/app.py @@ -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: