Class: Gcloud::Vision::Annotation::Face::Features::Lips

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

Overview

# Lips

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

See Gcloud::Vision::Annotation::Face::Features and Gcloud::Vision::Annotation::Face.

Examples:

require "gcloud"

gcloud = Gcloud.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

Constructor Details

#initialize(top, bottom) ⇒ Lips



1305
1306
1307
1308
# File 'lib/gcloud/vision/annotation/face.rb', line 1305

def initialize top, bottom
  @top = top
  @bottom = bottom
end

Instance Attribute Details

#bottomLandmark (readonly) Also known as: lower

The lower lip.



1297
1298
1299
# File 'lib/gcloud/vision/annotation/face.rb', line 1297

def bottom
  @bottom
end

#topLandmark (readonly) Also known as: upper

The upper lip.



1297
1298
1299
# File 'lib/gcloud/vision/annotation/face.rb', line 1297

def top
  @top
end

Instance Method Details

#inspectObject



1352
1353
1354
# File 'lib/gcloud/vision/annotation/face.rb', line 1352

def inspect
  "#<Lips #{self}>"
end

#to_aArray

Returns the object’s property values as an array.



1315
1316
1317
# File 'lib/gcloud/vision/annotation/face.rb', line 1315

def to_a
  to_ary
end

#to_aryArray

Returns the object’s property values as an array.



1324
1325
1326
# File 'lib/gcloud/vision/annotation/face.rb', line 1324

def to_ary
  [top, bottom]
end

#to_hHash

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



1333
1334
1335
# File 'lib/gcloud/vision/annotation/face.rb', line 1333

def to_h
  to_hash
end

#to_hashHash

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



1342
1343
1344
# File 'lib/gcloud/vision/annotation/face.rb', line 1342

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

#to_sObject



1347
1348
1349
# File 'lib/gcloud/vision/annotation/face.rb', line 1347

def to_s
  "(top: #{top.inspect}, bottom: #{bottom.inspect})"
end