|
@@ -123,6 +123,8 @@ def image_process(image_np, image_path, is_from_pdf=False, is_from_docx=False, u
|
|
|
# cv2.imwrite(idc_path, image_np)
|
|
|
|
|
|
# isr模型去除印章
|
|
|
+ image_np_source = image_np
|
|
|
+ _isr_time = time.time()
|
|
|
if count_red_pixel(image_np):
|
|
|
# 红色像素达到一定值才过模型
|
|
|
with open(image_path, "rb") as f:
|
|
@@ -140,6 +142,7 @@ def image_process(image_np, image_path, is_from_pdf=False, is_from_docx=False, u
|
|
|
else:
|
|
|
isr_path = image_path.split(".")[0] + "_isr." + image_path.split(".")[-1]
|
|
|
cv2.imwrite(isr_path, image_np)
|
|
|
+ log("isr total time"+str(time.time()-_isr_time))
|
|
|
|
|
|
# otr模型识别表格,需要图片resize成模型所需大小, 写入另一个路径
|
|
|
best_h, best_w = get_best_predict_size(image_np)
|