Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 48bd2c1

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

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Filter options
  • vision/cloud-client/face_detection
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed

‎vision/cloud-client/face_detection/faces.py

Copy file name to clipboardExpand all lines: vision/cloud-client/face_detection/faces.py
+2-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.