Skip to content

Commit

Permalink
remove usage outdated pillow api (#2605)
Browse files Browse the repository at this point in the history
CVS-159118
  • Loading branch information
eaidova authored Dec 17, 2024
1 parent f9881bf commit e5ff580
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion notebooks/paddle-ocr-webcam/paddle-ocr-webcam.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
" %pip install -q \"paddlepaddle>=2.5.1,<2.6.0\"\n",
"else:\n",
" %pip install -q \"paddlepaddle>=2.5.1\"\n",
"%pip install -q \"pyclipper>=1.2.1\" \"shapely>=1.7.1\" opencv-python tqdm"
"%pip install -q \"pyclipper>=1.2.1\" \"shapely>=1.7.1\" opencv-python tqdm \"Pillow>=10.0\""
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions notebooks/paddle-ocr-webcam/pre_post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ def draw_ocr_box_txt(image, boxes, txts, scores=None, drop_score=0.5, font_path=
font = ImageFont.truetype(font_path, font_size)
cur_y = box[0][1]
for c in txt:
char_size = font.getsize(c)
char_size = font.getbox(c)
draw_right.text((box[0][0] + 3, cur_y), c, fill=(0, 0, 0), font=font)
cur_y += char_size[1]
cur_y += char_size[-1]
else:
font_size = max(int(box_height * 0.8), 10)
font = ImageFont.truetype(font_path, font_size)
Expand Down

0 comments on commit e5ff580

Please sign in to comment.