Class: Gcloud::Vision::Annotation::Face::Features::Nose
- Inherits:
-
Object
- Object
- Gcloud::Vision::Annotation::Face::Features::Nose
- Defined in:
- lib/gcloud/vision/annotation/face.rb
Overview
# Nose
The landmarks of the nose in the features of a face.
Left and right are defined from the vantage of the viewer of the image, without considering mirror projections typical of photos. So face.features.eyes.left typically is the person’s right eye.
See Gcloud::Vision::Annotation::Face::Features and Gcloud::Vision::Annotation::Face.
Instance Attribute Summary collapse
-
#bottom ⇒ Landmark
readonly
The nose, bottom center.
-
#left ⇒ Landmark
readonly
The nose, bottom left.
-
#right ⇒ Landmark
readonly
The nose, bottom right.
-
#tip ⇒ Landmark
readonly
The nose tip.
-
#top ⇒ Landmark
readonly
The midpoint between the eyes.
Instance Method Summary collapse
-
#initialize(left, bottom, tip, top, right) ⇒ Nose
constructor
A new instance of Nose.
- #inspect ⇒ Object
-
#to_a ⇒ Array
Returns the object’s property values as an array.
-
#to_ary ⇒ Array
Returns the object’s property values as an array.
-
#to_h ⇒ Hash
Deeply converts object to a hash.
-
#to_hash ⇒ Hash
Deeply converts object to a hash.
- #to_s ⇒ Object
Constructor Details
#initialize(left, bottom, tip, top, right) ⇒ Nose
Returns a new instance of Nose.
1487 1488 1489 1490 1491 1492 1493 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1487 def initialize left, bottom, tip, top, right @left = left @bottom = bottom @tip = tip @top = top @right = right end |
Instance Attribute Details
#bottom ⇒ Landmark (readonly)
The nose, bottom center.
1482 1483 1484 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1482 def bottom @bottom end |
#left ⇒ Landmark (readonly)
The nose, bottom left.
1482 1483 1484 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1482 def left @left end |
#right ⇒ Landmark (readonly)
The nose, bottom right.
1482 1483 1484 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1482 def right @right end |
#tip ⇒ Landmark (readonly)
The nose tip.
1482 1483 1484 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1482 def tip @tip end |
#top ⇒ Landmark (readonly)
The midpoint between the eyes.
1482 1483 1484 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1482 def top @top end |
Instance Method Details
#inspect ⇒ Object
1541 1542 1543 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1541 def inspect "#<Nose #{self}>" end |
#to_a ⇒ Array
Returns the object’s property values as an array.
1500 1501 1502 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1500 def to_a to_ary end |
#to_ary ⇒ Array
Returns the object’s property values as an array.
1509 1510 1511 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1509 def to_ary [left, bottom, tip, top, right] end |
#to_h ⇒ Hash
Deeply converts object to a hash. All keys will be symbolized.
1518 1519 1520 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1518 def to_h to_hash end |
#to_hash ⇒ Hash
Deeply converts object to a hash. All keys will be symbolized.
1527 1528 1529 1530 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1527 def to_hash { left: left.to_h, bottom: bottom.to_h, tip: tip.to_h, top: top.to_h, right: right.to_h } end |
#to_s ⇒ Object
1533 1534 1535 1536 1537 1538 |
# File 'lib/gcloud/vision/annotation/face.rb', line 1533 def to_s tmplt = "(left: %s, bottom: %s, tip: %s, " \ "top: %s, right: %s)" format tmplt, left.inspect, bottom.inspect, tip.inspect, top.inspect, right.inspect end |