Skip to content

Commit f4e663d

Browse files
committed
pass mid inside top level stream_options
1 parent 36d83a6 commit f4e663d

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

mlapi.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,11 @@ def post(self):
118118
config_copy = None
119119
poly_copy = None
120120
ml_options = None
121-
121+
mid = None
122+
122123

123124
if not req:
124125
req = {}
125-
# abort(400, msg='Empty request')
126-
#g.logger.Debug (4,'***** REMOVE ME: g.monitor_config: {}'.format(g.monitor_config))
127-
#g.logger.Debug (4,'***** REMOVE ME: g.monitor_polygons: {}'.format(g.monitor_polygons))
128-
#g.logger.Debug (4,'***** REMOVE ME: g.monitor_zone_patterns: {}'.format(g.monitor_zone_patterns))
129-
130-
#g.logger.Debug (4,'***** REMOVE ME: Got req: {}'.format(req))
131126
if req.get('mid') and str(req.get('mid')) in g.monitor_config:
132127
mid = str(req.get('mid'))
133128
g.logger.Debug (1, f'Monitor ID {mid} provided & matching config found in mlapi, ignoring objectconfig.ini')
@@ -227,6 +222,7 @@ def post(self):
227222
#image = cv2.imread(fi)
228223
#bbox,label,conf = m.detect(image)
229224

225+
stream_options['mid'] = mid
230226
g.log.Debug (1, f'Calling detect streams with {stream} and {stream_options} and ml_overrides={ml_overrides} ml_options={ml_options}')
231227
#print (f'************************ {args}')
232228
matched_data,all_matches = m.detect_stream(stream=stream, options=stream_options, ml_overrides=ml_overrides)

0 commit comments

Comments
 (0)