Skip to content

Commit eaa32c1

Browse files
changdazhouTingquanGao
authored andcommitted
support print parsing_res_list
1 parent 61932c3 commit eaa32c1

File tree

1 file changed

+10
-0
lines changed
  • paddlex/inference/pipelines/paddleocr_vl

1 file changed

+10
-0
lines changed

paddlex/inference/pipelines/paddleocr_vl/result.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,16 @@ def _to_str(self, *args, **kwargs) -> dict[str, str]:
324324
data["doc_preprocessor_res"] = self["doc_preprocessor_res"].str["res"]
325325
if self["model_settings"]["use_layout_detection"]:
326326
data["layout_det_res"] = self["layout_det_res"].str["res"]
327+
parsing_res_list = self["parsing_res_list"]
328+
parsing_res_list = [
329+
{
330+
"block_label": parsing_res.label,
331+
"block_content": parsing_res.content,
332+
"block_bbox": parsing_res.bbox,
333+
}
334+
for parsing_res in parsing_res_list
335+
]
336+
data["parsing_res_list"] = parsing_res_list
327337
return JsonMixin._to_str(data, *args, **kwargs)
328338

329339
def _to_json(self, *args, **kwargs) -> dict[str, str]:

0 commit comments

Comments
 (0)