qsitj commited on
Commit
ee55cf2
·
verified ·
1 Parent(s): fd08bcf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -69,7 +69,8 @@ def get_annotated_image(in_pil_img):
69
  # 计算字体大小
70
  box_width = box['xmax'] - box['xmin']
71
  font_size = get_font_size(box_width)
72
- font = ImageFont.truetype("arial.ttf", size=font_size) # 确保你有可用的字体文件
 
73
 
74
  # 获取文本边界框
75
  text = f"{label}: {score}%"
 
69
  # 计算字体大小
70
  box_width = box['xmax'] - box['xmin']
71
  font_size = get_font_size(box_width)
72
+ font = ImageFont.load_default()
73
+ font = ImageFont.truetype(font=font, size=font_size) # 确保你有可用的字体文件
74
 
75
  # 获取文本边界框
76
  text = f"{label}: {score}%"