Browse Source

fix img channel in saving markdown

gaotingquan 8 months ago
parent
commit
d9d270dd13
1 changed files with 1 additions and 2 deletions
  1. 1 2
      paddlex/inference/pipelines/layout_parsing/utils.py

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

@@ -842,8 +842,7 @@ def _img_array2path(data: np.ndarray) -> str:
     if isinstance(data, np.ndarray) and data.ndim == 3:
         # Generate a unique filename using UUID
         img_name = f"image_{uuid.uuid4().hex}.png"
-
-        return {f"imgs/{img_name}": Image.fromarray(data)}
+        return {f"imgs/{img_name}": Image.fromarray(data[:, :, ::-1])}
     else:
         raise ValueError(
             "Input data must be a 3-dimensional numpy array representing an image."