liuhongen1234567 8 mesiacov pred
rodič
commit
b223c1bd2e

+ 9 - 0
paddlex/inference/pipelines/formula_recognition/result.py

@@ -45,6 +45,15 @@ from ...models.formula_recognition.result import (
 class FormulaRecognitionResult(BaseCVResult):
     """Formula Recognition Result"""
 
+    def _get_input_fn(self):
+        fn = super()._get_input_fn()
+        if (page_idx := self["page_index"]) is not None:
+            fp = Path(fn)
+            stem, suffix = fp.stem, fp.suffix
+            return f"{stem}_{page_idx}{suffix}"
+        else:
+            return fn
+
     def _to_img(self) -> Dict[str, Image.Image]:
         """
         Converts the internal data to a PIL Image with detection and recognition results.