Class: Google::Apis::VisionV1::EntityAnnotation

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/vision_v1/classes.rb,
generated/google/apis/vision_v1/representations.rb,
generated/google/apis/vision_v1/representations.rb

Overview

Set of detected entity features.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ EntityAnnotation

Returns a new instance of EntityAnnotation



531
532
533
# File 'generated/google/apis/vision_v1/classes.rb', line 531

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#bounding_polyGoogle::Apis::VisionV1::BoundingPoly

A bounding polygon for the detected image annotation. Corresponds to the JSON property boundingPoly



498
499
500
# File 'generated/google/apis/vision_v1/classes.rb', line 498

def bounding_poly
  @bounding_poly
end

#confidenceFloat

The accuracy of the entity detection in an image. For example, for an image in which the "Eiffel Tower" entity is detected, this field represents the confidence that there is a tower in the query image. Range [0, 1]. Corresponds to the JSON property confidence

Returns:

  • (Float)


493
494
495
# File 'generated/google/apis/vision_v1/classes.rb', line 493

def confidence
  @confidence
end

#descriptionString

Entity textual description, expressed in its locale language. Corresponds to the JSON property description

Returns:

  • (String)


509
510
511
# File 'generated/google/apis/vision_v1/classes.rb', line 509

def description
  @description
end

#localeString

The language code for the locale in which the entity textual description is expressed. Corresponds to the JSON property locale

Returns:

  • (String)


504
505
506
# File 'generated/google/apis/vision_v1/classes.rb', line 504

def locale
  @locale
end

#locationsArray<Google::Apis::VisionV1::LocationInfo>

The location information for the detected entity. Multiple LocationInfo elements can be present because one location may indicate the location of the scene in the image, and another location may indicate the location of the place where the image was taken. Location information is usually present for landmarks. Corresponds to the JSON property locations



478
479
480
# File 'generated/google/apis/vision_v1/classes.rb', line 478

def locations
  @locations
end

#midString

Opaque entity ID. Some IDs may be available in Google Knowledge Graph Search API. Corresponds to the JSON property mid

Returns:

  • (String)


485
486
487
# File 'generated/google/apis/vision_v1/classes.rb', line 485

def mid
  @mid
end

#propertiesArray<Google::Apis::VisionV1::Property>

Some entities may have optional user-supplied Property (name/value) fields, such a score or string that qualifies the entity. Corresponds to the JSON property properties



524
525
526
# File 'generated/google/apis/vision_v1/classes.rb', line 524

def properties
  @properties
end

#scoreFloat

Overall score of the result. Range [0, 1]. Corresponds to the JSON property score

Returns:

  • (Float)


529
530
531
# File 'generated/google/apis/vision_v1/classes.rb', line 529

def score
  @score
end

#topicalityFloat

The relevancy of the ICA (Image Content Annotation) label to the image. For example, the relevancy of "tower" is likely higher to an image containing the detected "Eiffel Tower" than to an image containing a detected distant towering building, even though the confidence that there is a tower in each image may be the same. Range [0, 1]. Corresponds to the JSON property topicality

Returns:

  • (Float)


518
519
520
# File 'generated/google/apis/vision_v1/classes.rb', line 518

def topicality
  @topicality
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



536
537
538
539
540
541
542
543
544
545
546
# File 'generated/google/apis/vision_v1/classes.rb', line 536

def update!(**args)
  @locations = args[:locations] if args.key?(:locations)
  @mid = args[:mid] if args.key?(:mid)
  @confidence = args[:confidence] if args.key?(:confidence)
  @bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
  @locale = args[:locale] if args.key?(:locale)
  @description = args[:description] if args.key?(:description)
  @topicality = args[:topicality] if args.key?(:topicality)
  @properties = args[:properties] if args.key?(:properties)
  @score = args[:score] if args.key?(:score)
end