优化文档检测为接口

This commit is contained in:
2024-08-28 17:14:43 +08:00
parent 06b637544a
commit a427ad01b9
4 changed files with 77 additions and 3 deletions

View File

@@ -82,7 +82,9 @@ def information_extraction(ie, phrecs, identity):
image = image_util.read(img_path)
target_images = []
target_images += detector.get_book_areas(image) # 识别文档区域并裁剪
det_time = time.time()
target_images += detector.request_book_areas(image) # 识别文档区域并裁剪
logging.info(f"检测目标耗时{time.time() - det_time}")
if not target_images:
target_images.append(image) # 识别失败
angle_count = defaultdict(int, {"0": 0}) # 分割后图片的最优角度统计