Search code examples
tensorflowobject-detection

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


I have increased the font size to 30 from the default size 24 inside the draw_bounding_box_on_image() in visualization_utils.py

font = ImageFont.truetype('arial.ttf', 30)

But still the font size is not getting changed.

enter image description here


Solution

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

    Also, we can put the .ttf file in the current folder and use

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