Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion videointelligence/samples/analyze/video_detect_faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def detect_faces(local_file_path="path/to/your/video-file.mp4"):
print("\tright : {}".format(box.right))
print("\tbottom: {}".format(box.bottom))

# Attributes include glasses, headwear, smiling, direction of gaze
# Attributes include glasses, headwear, frontal_gaze,
# eyes_visible, mouth_open
print("Attributes:")
for attribute in timestamped_object.attributes:
print(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ def detect_faces(gcs_uri="gs://YOUR_BUCKET_ID/path/to/your/video.mp4"):
print("\tright : {}".format(box.right))
print("\tbottom: {}".format(box.bottom))

# Attributes include glasses, headwear, smiling, direction of gaze
# Attributes include glasses, headwear, frontal_gaze,
# eyes_visible, mouth_open
print("Attributes:")
for attribute in timestamped_object.attributes:
print(
Expand Down
12 changes: 6 additions & 6 deletions vision/snippets/detect/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ def detect_faces(path):
print("Faces:")

for face in faces:
print(f"anger: {likelihood_name[face.anger_likelihood]}")
print(f"joy: {likelihood_name[face.joy_likelihood]}")
print(f"surprise: {likelihood_name[face.surprise_likelihood]}")
print(f"headwear: {likelihood_name[face.headwear_likelihood]}")
print(f"under exposed: {likelihood_name[face.under_exposed_likelihood]}")
print(f"blurred: {likelihood_name[face.blurred_likelihood]}")

vertices = [
f"({vertex.x},{vertex.y})" for vertex in face.bounding_poly.vertices
Expand Down Expand Up @@ -113,9 +113,9 @@ def detect_faces_uri(uri):
print("Faces:")

for face in faces:
print(f"anger: {likelihood_name[face.anger_likelihood]}")
print(f"joy: {likelihood_name[face.joy_likelihood]}")
print(f"surprise: {likelihood_name[face.surprise_likelihood]}")
print(f"headwear: {likelihood_name[face.headwear_likelihood]}")
print(f"under exposed: {likelihood_name[face.under_exposed_likelihood]}")
print(f"blurred: {likelihood_name[face.blurred_likelihood]}")

vertices = [
f"({vertex.x},{vertex.y})" for vertex in face.bounding_poly.vertices
Expand Down