From 9b92e2c6a46c653023261b4cb05fde8c7ccd3c56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=A8?= Date: Mon, 24 Apr 2023 17:55:04 +0800 Subject: [PATCH] update --- ieemoo-ai-searchv2.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ieemoo-ai-searchv2.py b/ieemoo-ai-searchv2.py index 8219741..5dbfb92 100755 --- a/ieemoo-ai-searchv2.py +++ b/ieemoo-ai-searchv2.py @@ -80,16 +80,23 @@ def search(): else: state = analysis_video(raft_model, videoPath, '',uuid_barcode,None,net=net, transform=transform,ms=ms, match=True) result = uuid_barcode+'_'+state #参数修改返回结果 + try: + thread = Thread(target=AddObs, kwargs={'file_path':videoPath, 'status':state}) + thread.start() + logger.info(result) + print('result >>>>> {}'.format(result)) + return result + except Exception as e: + print('result >>>>> {}'.format(result)) + return result except Exception as e: logger.warning(e) #异常返回00 - thread = Thread(target=AddObs, kwargs={'file_path':videoPath, 'status':status[3]}) - thread.start() - return uuid_barcode+'_'+status[3] #参数修改返回00 - thread = Thread(target=AddObs, kwargs={'file_path':videoPath, 'status':state}) - thread.start() - logger.info(result) - print('result >>>>> {}'.format(result)) - return result + try: + thread = Thread(target=AddObs, kwargs={'file_path':videoPath, 'status':status[3]}) + thread.start() + return uuid_barcode+'_'+status[3] #参数修改返回00 + except Exception as e: + return uuid_barcode+'_'+status[3] #参数修改返回00 if __name__ == '__main__': app.run(host='0.0.0.0', port=8085)