提交 d0ed1c24 authored 作者: blu's avatar blu

human detection: region

上级 65daa1fa
......@@ -218,15 +218,17 @@ def video_analysis(data):
os.system('mkdir -p ' + downloadDir)
downloadFile(ipcSN, dirName, fileName, downloadDir)
region = None
if ipcSN in CAMERA_CONFIG_MAP:
if ipcSN in CAMERA_CONFIG_MAP and type(CAMERA_CONFIG_MAP[ipcSN]) is dict:
region = CAMERA_CONFIG_MAP[ipcSN]['region']
else:
else ipcSN is not in CAMERA_CONFIG_MAP:
res = requests.get(API_HOST + API_CAMERA_CFG_URI)
try:
if res.status_code == 200:
if "region" in res.json():
region = res.json()["region"]
CAMERA_CONFIG_MAP[ipcSN] = res.json()
if ipcSN is not in CAMERA_CONFIG_MAP:
CAMERA_CONFIG_MAP[ipCSN] = 0
except Exception as e:
print("failed to get camera config {}: {}".format(ipcSN, e))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论