提交 75b89ac2 authored 作者: blu's avatar blu

human detect: bugfix

上级 1f291f58
...@@ -605,7 +605,7 @@ private: ...@@ -605,7 +605,7 @@ private:
origin = origin(crop); origin = origin(crop);
} }
//imgScalor = w * h / (FRAME_SIZE * FRAME_SIZE * 1.0); // imgScalor = w * h / (FRAME_SIZE * FRAME_SIZE * 1.0);
// cv::resize(origin, gray, cv::Size(FRAME_SIZE,FRAME_SIZE)); // cv::resize(origin, gray, cv::Size(FRAME_SIZE,FRAME_SIZE));
cv::Mat gray; cv::Mat gray;
cv::cvtColor(origin, gray, cv::COLOR_BGR2GRAY); cv::cvtColor(origin, gray, cv::COLOR_BGR2GRAY);
......
...@@ -190,11 +190,11 @@ def getRegionConfig(ipcSN): ...@@ -190,11 +190,11 @@ def getRegionConfig(ipcSN):
region = None region = None
res = None res = None
reqUrl = API_HOST + API_CAMERA_CFG_URI.format(ipcSN) reqUrl = API_HOST + API_CAMERA_CFG_URI.format(ipcSN)
if ipcSN in CAMERA_CONFIG_MAP and type(CAMERA_CONFIG_MAP[ipcSN]) is dict: try:
region = CAMERA_CONFIG_MAP[ipcSN]['region'] if ipcSN in CAMERA_CONFIG_MAP and type(CAMERA_CONFIG_MAP[ipcSN]) is dict:
elif CAMERA_CONFIG_MAP.get(ipcSN) is None and API_HOST: region = CAMERA_CONFIG_MAP[ipcSN]['region']
res = requests.get(reqUrl) elif CAMERA_CONFIG_MAP.get(ipcSN) is None and API_HOST:
try: res = requests.get(reqUrl)
if res.status_code == 200: if res.status_code == 200:
ret = res.json() ret = res.json()
if 'data' in ret and 'region' in ret['data']: if 'data' in ret and 'region' in ret['data']:
...@@ -202,9 +202,9 @@ def getRegionConfig(ipcSN): ...@@ -202,9 +202,9 @@ def getRegionConfig(ipcSN):
CAMERA_CONFIG_MAP[ipcSN] = ret["data"] CAMERA_CONFIG_MAP[ipcSN] = ret["data"]
if CAMERA_CONFIG_MAP.get(ipcSN) is None: if CAMERA_CONFIG_MAP.get(ipcSN) is None:
CAMERA_CONFIG_MAP[ipCSN] = 0 CAMERA_CONFIG_MAP[ipCSN] = 0
except Exception as e: print("getRegionConfig: {}, {}, {}: {}".format(ipcSN, reqUrl, res.text if res and (text in res) else None, json.dumps(region)))
except Exception as e:
print("failed to get camera config {}: {}".format(ipcSN, e)) print("failed to get camera config {}: {}".format(ipcSN, e))
print("getRegionConfig: {}, {}, {}: {}".format(ipcSN, reqUrl, res.text, json.dumps(region)))
return region return region
def take_task(task): def take_task(task):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论