Skip to content

Commit 48bd2c1

Browse files
authored
Use default font (#1865)
Test environment does not support all fonts.
1 parent 9a214a7 commit 48bd2c1

File tree

1 file changed

+2
-3
lines changed
  • vision/cloud-client/face_detection

1 file changed

+2
-3
lines changed

vision/cloud-client/face_detection/faces.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# [START vision_face_detection_tutorial_imports]
2222
from google.cloud import vision
2323
from google.cloud.vision import types
24-
from PIL import Image, ImageDraw, ImageFont
24+
from PIL import Image, ImageDraw
2525
# [END vision_face_detection_tutorial_imports]
2626

2727

@@ -60,7 +60,6 @@ def highlight_faces(image, faces, output_filename):
6060
im = Image.open(image)
6161
draw = ImageDraw.Draw(im)
6262
# Sepecify the font-family and the font-size
63-
font = ImageFont.truetype("arial.ttf", 25)
6463
for face in faces:
6564
box = [(vertex.x, vertex.y)
6665
for vertex in face.bounding_poly.vertices]
@@ -70,7 +69,7 @@ def highlight_faces(image, faces, output_filename):
7069
draw.text(((face.bounding_poly.vertices)[0].x,
7170
(face.bounding_poly.vertices)[0].y - 30),
7271
str(format(face.detection_confidence, '.3f')) + '%',
73-
font=font, fill='#FF0000')
72+
fill='#FF0000')
7473
im.save(output_filename)
7574
# [END vision_face_detection_tutorial_process_response]
7675

0 commit comments

Comments
 (0)