Class: Google::Cloud::Vision::Annotation::Face::Features::Lips

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/vision/annotation/face.rb

Overview

Lips

The landmarks of the lips in the features of a face.

See Google::Cloud::Vision::Annotation::Face::Features and Google::Cloud::Vision::Annotation::Face.

Examples:

require "google/cloud/vision"

vision = Google::Cloud::Vision.new

image = vision.image "path/to/face.jpg"
face = image.face

lips = face.features.lips

lips.top
#=> #<Landmark (x: 228.54768, y: 143.2952, z: -5.6550336)>

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bottomLandmark (readonly) Also known as: lower

The lower lip.

Returns:

  • (Landmark)

    the current value of bottom



1107
1108
1109
# File 'lib/google/cloud/vision/annotation/face.rb', line 1107

def bottom
  @bottom
end

#topLandmark (readonly) Also known as: upper

The upper lip.

Returns:

  • (Landmark)

    the current value of top



1107
1108
1109
# File 'lib/google/cloud/vision/annotation/face.rb', line 1107

def top
  @top
end

Instance Method Details

#to_aArray

Returns the object's property values as an array.

Returns:

  • (Array)


1125
1126
1127
# File 'lib/google/cloud/vision/annotation/face.rb', line 1125

def to_a
  [top, bottom]
end

#to_hHash

Deeply converts object to a hash. All keys will be symbolized.

Returns:

  • (Hash)


1134
1135
1136
# File 'lib/google/cloud/vision/annotation/face.rb', line 1134

def to_h
  { top: top.to_h, bottom: bottom.to_h }
end