Class: Google::Cloud::Vision::Annotation::Face
- Inherits:
-
Object
- Object
- Google::Cloud::Vision::Annotation::Face
- Defined in:
- lib/google/cloud/vision/annotation/face.rb
Overview
Defined Under Namespace
Classes: Angles, Bounds, Features, Likelihood
Instance Attribute Summary collapse
Class Method Summary collapse
Instance Method Summary collapse
-
#angles ⇒ Angles
The angles of the face, including roll, yaw, and pitch.
-
#bounds ⇒ Bounds
The bounds of the face, including the polygons for the head and face.
-
#confidence ⇒ Float
The confidence of the facial detection.
-
#features ⇒ Features
The landmarks of the face, including the points for the eyes, ears, nose and mouth.
-
#initialize ⇒ Face
constructor
A new instance of Face.
- #inspect ⇒ Object
-
#likelihood ⇒ Likelihood
The likelihood of the facial detection, including joy, sorrow, anger, surprise, under_exposed, blurred, and headwear.
-
#to_h ⇒ Hash
Deeply converts object to a hash.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Face
Returns a new instance of Face.
46 47 48 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 46 def initialize @grpc = nil end |
Instance Attribute Details
#grpc ⇒ Object
42 43 44 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 42 def grpc @grpc end |
Class Method Details
.from_grpc(grpc) ⇒ Object
121 122 123 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 121 def self.from_grpc grpc new.tap { |f| f.instance_variable_set :@grpc, grpc } end |
Instance Method Details
#angles ⇒ Angles
The angles of the face, including roll, yaw, and pitch.
55 56 57 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 55 def angles @angles ||= Angles.from_grpc @grpc end |
#bounds ⇒ Bounds
The bounds of the face, including the polygons for the head and face.
65 66 67 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 65 def bounds @bounds ||= Bounds.from_grpc @grpc end |
#confidence ⇒ Float
The confidence of the facial detection.
94 95 96 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 94 def confidence @grpc.detection_confidence end |
#features ⇒ Features
The landmarks of the face, including the points for the eyes, ears, nose and mouth.
75 76 77 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 75 def features @features ||= Features.from_grpc @grpc end |
#inspect ⇒ Object
115 116 117 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 115 def inspect "#<#{self.class.name} #{self}>" end |
#likelihood ⇒ Likelihood
The likelihood of the facial detection, including joy, sorrow, anger, surprise, under_exposed, blurred, and headwear.
85 86 87 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 85 def likelihood @likelihood ||= Likelihood.from_grpc @grpc end |
#to_h ⇒ Hash
Deeply converts object to a hash. All keys will be symbolized.
103 104 105 106 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 103 def to_h { angles: angles.to_h, bounds: bounds.to_h, features: features.to_h, likelihood: likelihood.to_h } end |
#to_s ⇒ Object
109 110 111 112 |
# File 'lib/google/cloud/vision/annotation/face.rb', line 109 def to_s # Keep console output low by not showing all sub-objects. "(angles, bounds, features, likelihood)" end |