macOS mojave python 3.6
Object detection displays the detection result on the image, but when I detected it on my own image, the class name was too small to read. In the tutorial image, it is displayed in a size that is easy to see. https://github.com/tensorflow/models/tree/master/research/object_detection
The code to draw the detection result is written in the following file. object_detection/utils/visualization_utils.py
As of December 4, 2019, the font size is specified on line 208.
try:
font = ImageFont.truetype('arial.ttf', 24)
except IOError:
font = ImageFont.load_default()
Change the code as follows.
try:
font = ImageFont.truetype('/Library/Fonts/arial.ttf', 8)
except IOError:
font = ImageFont.load_default()
I was able to make the font size smaller. The font size did not change well unless I respecified not only the font size but also the font type path.
Recommended Posts