Skip to content

Commit

Permalink
pass zone number in
Browse files Browse the repository at this point in the history
  • Loading branch information
yimm0815 committed Dec 18, 2019
1 parent 88ec21e commit 629ea82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions analytics/common/runva.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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"]
},
Expand Down
3 changes: 2 additions & 1 deletion analytics/crowd-counting/count-crowd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit 629ea82

Please sign in to comment.