提交 6dd8da08 编写于 作者: A andyjpaddle

format code

上级 e348e7fe
......@@ -326,11 +326,9 @@ if __name__ == "__main__":
else:
logger.info("{} The predict time of {}: {}".format(
idx, image_file, elapse))
if flag_pdf:
src_im = utility.draw_text_det_res(dt_boxes, img, flag_pdf)
else:
src_im = utility.draw_text_det_res(dt_boxes, image_file,
flag_pdf)
src_im = utility.draw_text_det_res(dt_boxes, img)
if flag_gif:
save_file = image_file[:-3] + "png"
elif flag_pdf:
......
......@@ -338,15 +338,11 @@ def draw_e2e_res(dt_boxes, strs, img_path):
return src_im
def draw_text_det_res(dt_boxes, img_path, flag_pdf=False):
if not flag_pdf:
src_im = cv2.imread(img_path)
else:
src_im = img_path
def draw_text_det_res(dt_boxes, img):
for box in dt_boxes:
box = np.array(box).astype(np.int32).reshape(-1, 2)
cv2.polylines(src_im, [box], True, color=(255, 255, 0), thickness=2)
return src_im
cv2.polylines(img, [box], True, color=(255, 255, 0), thickness=2)
return img
def resize_img(img, input_size=600):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册