Skip to content

Commit 79422e0

Browse files
authored
bugfix (#4293)
1 parent 017ea02 commit 79422e0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

paddlex/inference/pipelines/ocr/result.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,10 @@ def _to_img(self) -> Dict[str, Image.Image]:
8181
img_right = np.ones((h, w, 3), dtype=np.uint8) * 255
8282
random.seed(0)
8383
draw_left = ImageDraw.Draw(img_left)
84+
vis_font = SIMFANG_FONT
85+
if self["vis_fonts"]:
86+
vis_font = self["vis_fonts"][0]
8487
for idx, (box, txt) in enumerate(zip(boxes, txts)):
85-
vis_font = (
86-
self["vis_fonts"][idx]
87-
if self["vis_fonts"][idx] is not None
88-
else SIMFANG_FONT
89-
)
9088
try:
9189
color = (
9290
random.randint(0, 255),

0 commit comments

Comments
 (0)