diff --git a/analytics/common/runva.py b/analytics/common/runva.py index a1ba9f3c1..69148749c 100755 --- a/analytics/common/runva.py +++ b/analytics/common/runva.py @@ -27,7 +27,7 @@ def __init__(self, pipeline, version="2"): def stop(self): self._stop=True - def loop(self, sensor, location, uri, topic, algorithm, algorithmName, resolution={}): + def loop(self, sensor, location, uri, topic, algorithm, algorithmName, resolution={}, zone=0): if algorithmName=="crowd-counting": pid,msg=PipelineManager.create_instance(self._pipeline,self._version,{ "source": { @@ -57,7 +57,7 @@ def loop(self, sensor, location, uri, topic, algorithm, algorithmName, resolutio }, "parameters": { "crowd_count": { - "zone": 8, + "zone": zone, "width": resolution["width"], "height": resolution["height"] }, diff --git a/analytics/crowd-counting/count-crowd.py b/analytics/crowd-counting/count-crowd.py index 43db0b1bd..f9c254a86 100755 --- a/analytics/crowd-counting/count-crowd.py +++ b/analytics/crowd-counting/count-crowd.py @@ -28,6 +28,7 @@ def connect(sensor, location, uri, algorithm, algorithmName, resolution, zonemap global mqtt2db, rec2db, runva print("==============count-crowd:connect:zonemap=",zonemap,"========================",flush=True) + try: mqtt2db=MQTT2DB(algorithm) # this waits for mqtt rec2db=Rec2DB(sensor) @@ -40,7 +41,7 @@ def connect(sensor, location, uri, algorithm, algorithmName, resolution, zonemap # any VA exit indicates a camera disconnect with ThreadPoolExecutor(1) as e1: - e1.submit(runva.loop, sensor, location, uri, topic, algorithm, algorithmName, resolution) + e1.submit(runva.loop, sensor, location, uri, topic, algorithm, algorithmName, resolution, zonemap[0]["zone"]) if not stop: mqtt2db.stop()