算法 log 一下

This commit is contained in:
caoqianming 2023-02-13 15:57:02 +08:00
parent d7a6adead7
commit d638448fa6
1 changed files with 2 additions and 0 deletions

View File

@ -53,6 +53,7 @@ def ai_analyse(codes: list, global_img: str, face_img: str = '', is_dahua_pic: b
is_happend, res = getattr(m, 'helmet2')(ip=settings.AI_IP, pic_url=global_img)
else:
is_happend, res = f(ip=settings.AI_IP, pic_url=global_img)
myLogger.info(res)
if i in ['fire1', 'jingjiedai', 'qiping']: # 如果是这3类算法就无需再识别都在一个算法里处理了
has_fire = False # 默认没有灭火器
has_jingjiedai = False # 默认没有警戒带
@ -71,6 +72,7 @@ def ai_analyse(codes: list, global_img: str, face_img: str = '', is_dahua_pic: b
results.update({i: rectangle_dict.get(i, [])})
if is_happend and (i not in results):
results.update({i: rectangle_dict.get(i, [])})
myLogger.info(results)
except Exception:
myLogger.error('算法处理错误', exc_info=True)
if global_img_path: