Prechádzať zdrojové kódy

fix that when both layout result and ocr result are null

gaotingquan 8 mesiacov pred
rodič
commit
896dd270e1

+ 2 - 0
paddlex/inference/pipelines/layout_parsing/utils.py

@@ -1233,6 +1233,8 @@ def _get_sub_category(
             if num_doc_title == 2:
                 special_pre_cut_labels = title_labels + sub_title_labels
                 break
+    if len(blocks) == 0:
+        return blocks, {}
 
     min_x = min(block["block_bbox"][0] for block in blocks)
     min_y = min(block["block_bbox"][1] for block in blocks)