如何增加 Tensorflow 对象检测模块中边界框的字体大小?

How to increase the font size of the bounding box in Tensorflow object detection module?

我已将 visualization_utils.py

中 draw_bounding_box_on_image() 内的字体大小从默认大小 24 增加到 30

字体 = ImageFont.truetype('arial.ttf', 30)

但字体大小仍然没有改变。

i found the issue.
On Mac we need to give the full path.
ImageFont.truetype('/Library/Fonts/Arial.ttf', 30)

另外,我们可以将.ttf文件放在当前文件夹中,使用

 ImageFont.truetype('./Arial.ttf', 30)

对于ubuntuOS,我做了以下操作

    import matplotlib.font_manager as fm
...
  try:
    font = ImageFont.truetype(fm.findfont(fm.FontProperties(family='DejaVu Sans')), 50)
  except IOError:
    font = ImageFont.load_default()

它奏效了:) PS。我想它适用于任何 OS.