提交 8cd5cd32 authored 作者: blu's avatar blu

revise

上级 336b46d5
...@@ -363,9 +363,13 @@ def video_analysis(data): ...@@ -363,9 +363,13 @@ def video_analysis(data):
with open(jsonFile, 'w') as outfile: with open(jsonFile, 'w') as outfile:
json.dump(ret, outfile) json.dump(ret, outfile)
# upload # upload
try:
uploadFile(ipcSN, dirName, 'result.json', downloadDir) uploadFile(ipcSN, dirName, 'result.json', downloadDir)
if ret['data']['humanDetect']['found'] != 0: if ret['data']['humanDetect']['found'] != 0:
uploadFile(ipcSN, dirName, imageName, downloadDir) uploadFile(ipcSN, dirName, imageName, downloadDir)
except Exception as e:
ret["code"] = 1
ret["msg"] = "failed to save file: " + str(e)
# pub msg # pub msg
if MQTT_HOST: if MQTT_HOST:
mc = mqtt.Client((MQTT_CID + '-pub') if MQTT_CID else "vamqtt-pub") mc = mqtt.Client((MQTT_CID + '-pub') if MQTT_CID else "vamqtt-pub")
...@@ -388,11 +392,6 @@ def video_analysis(data): ...@@ -388,11 +392,6 @@ def video_analysis(data):
properties=pika.BasicProperties(delivery_mode = 2)) properties=pika.BasicProperties(delivery_mode = 2))
print("rabbitmq message published") print("rabbitmq message published")
rabChanResult.close() rabChanResult.close()
try:
os.system('rm -fr ' + downloadDir)
except Exception as e:
print('cascaded exception in va: {}'.format(e))
return ret return ret
...@@ -400,3 +399,4 @@ if __name__ == '__main__': ...@@ -400,3 +399,4 @@ if __name__ == '__main__':
mq = VAMMQTTClient(take_task) mq = VAMMQTTClient(take_task)
app.config['mc'] = mq.client app.config['mc'] = mq.client
app.run(host='0.0.0.0', port='5000') app.run(host='0.0.0.0', port='5000')
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论