zhouchangda 5 ヶ月 前
コミット
3911da275a

+ 3 - 2
paddlex/inference/pipelines/layout_parsing/xycut_enhanced/utils.py

@@ -69,9 +69,10 @@ def projection_by_bboxes(boxes: np.ndarray, axis: int) -> np.ndarray:
     """
     assert axis in [0, 1]
 
-    max_length = np.max(boxes[:, axis::2])
-    if max_length < 0:
+    if np.min(boxes[:, axis::2]) < 0:
         max_length = abs(np.min(boxes[:, axis::2]))
+    else:
+        max_length = np.max(boxes[:, axis::2])
 
     projection = np.zeros(max_length, dtype=int)