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"

gcloud = Google::Cloud.new
vision = gcloud.vision

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



1121
1122
1123
# File 'lib/google/cloud/vision/annotation/face.rb', line 1121

def bottom
  @bottom
end

#topLandmark (readonly) Also known as: upper

The upper lip.

Returns:

  • (Landmark)

    the current value of top



1121
1122
1123
# File 'lib/google/cloud/vision/annotation/face.rb', line 1121

def top
  @top
end

Instance Method Details

#to_aArray

Returns the object's property values as an array.

Returns:

  • (Array)


1139
1140
1141
# File 'lib/google/cloud/vision/annotation/face.rb', line 1139

def to_a
  [top, bottom]
end

#to_hHash

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

Returns:

  • (Hash)


1148
1149
1150
# File 'lib/google/cloud/vision/annotation/face.rb', line 1148

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