添加ocr识别结果为空的判断

This commit is contained in:
2024-06-24 13:49:58 +08:00
parent 5cfbdd5a6e
commit 7820b4b762

View File

@@ -115,6 +115,8 @@ def get_ocr_layout(img_path):
layout = []
ocr_result = OCR.ocr(img_path)
ocr_result = ocr_result[0]
if not ocr_result:
return layout
for segment in ocr_result:
box = segment[0]
box = _get_box(box)