Merge branch 'master' of https://e.coding.net/ctcdevteam/ehs/ehs_server
This commit is contained in:
commit
874d427df3
|
@ -90,7 +90,7 @@ def fangtangfu(ip: str, pic_url: str):
|
|||
image_id = 4
|
||||
request = BeiHangGrpc_pb2.JinYu_Request(zzid=image_id, imgUrl=pic_url)
|
||||
response = stub.sendFA_Info(request)
|
||||
if response.FAinfo == False:
|
||||
if response.FAinfo is False:
|
||||
return True, response
|
||||
return False, response
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ algo_dict = {
|
|||
}
|
||||
|
||||
|
||||
def ai_analyse(codes: list, global_img: str, face_img: str = None, is_dahua_pic: bool = True):
|
||||
def ai_analyse(codes: list, global_img: str, face_img: str = '', is_dahua_pic: bool = True):
|
||||
"""算法分析图片
|
||||
|
||||
Args:
|
||||
|
@ -59,7 +59,8 @@ def ai_analyse(codes: list, global_img: str, face_img: str = None, is_dahua_pic:
|
|||
for x in res.FireinfoList:
|
||||
if x.fire == 3: # 气瓶倾倒
|
||||
qiping_qd = True
|
||||
rectangle_dict['qiping'].append([(x.coord.uleft.x, x.coord.uleft.y), (x.coord.lright.x, x.coord.lright.y)]) # 加入矩形框
|
||||
rectangle_dict['qiping'].append(
|
||||
[(x.coord.uleft.x, x.coord.uleft.y), (x.coord.lright.x, x.coord.lright.y)]) # 加入矩形框
|
||||
if x.fire == 0:
|
||||
has_fire = True
|
||||
if x.fire == 2:
|
||||
|
@ -77,7 +78,7 @@ def ai_analyse(codes: list, global_img: str, face_img: str = None, is_dahua_pic:
|
|||
return results
|
||||
|
||||
|
||||
def ai_analyse_2(codes: list, global_img: str, face_img: str = None, is_dahua_pic: bool = True):
|
||||
def ai_analyse_2(codes: list, global_img: str, face_img: str = '', is_dahua_pic: bool = True):
|
||||
"""算法分析图片后保存并返回相对地址
|
||||
|
||||
Args:
|
||||
|
@ -94,6 +95,7 @@ def ai_analyse_2(codes: list, global_img: str, face_img: str = None, is_dahua_pi
|
|||
results.update({'global_img': global_img_path})
|
||||
return results
|
||||
|
||||
|
||||
def draw(path, results):
|
||||
rects = []
|
||||
for i in results:
|
||||
|
@ -106,4 +108,3 @@ def draw(path, results):
|
|||
cv2.rectangle(img, results[i][m][0], results[i][m][1], (0, 255, 0), 4)
|
||||
cv2.putText(img, i, results[i][m][0], font, 2, (0, 0, 255), 1)
|
||||
cv2.imwrite(path, img)
|
||||
|
||||
|
|
Loading…
Reference in New Issue