Skip to content

Commit e656b79

Browse files
fix formula pipe (#3466)
1 parent 3010c22 commit e656b79

File tree

1 file changed

+9
-0
lines changed
  • paddlex/inference/pipelines/formula_recognition

1 file changed

+9
-0
lines changed

paddlex/inference/pipelines/formula_recognition/result.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@
4545
class FormulaRecognitionResult(BaseCVResult):
4646
"""Formula Recognition Result"""
4747

48+
def _get_input_fn(self):
49+
fn = super()._get_input_fn()
50+
if (page_idx := self["page_index"]) is not None:
51+
fp = Path(fn)
52+
stem, suffix = fp.stem, fp.suffix
53+
return f"{stem}_{page_idx}{suffix}"
54+
else:
55+
return fn
56+
4857
def _to_img(self) -> Dict[str, Image.Image]:
4958
"""
5059
Converts the internal data to a PIL Image with detection and recognition results.

0 commit comments

Comments
 (0)