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

Update app.py

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