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.



776
777
778
# File 'generated/google/apis/vision_v1/classes.rb', line 776

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



758
759
760
# File 'generated/google/apis/vision_v1/classes.rb', line 758

def bounding_poly
  @bounding_poly
end

#confidenceFloat

The accuracy of the entity detection in an image. For example, for an image containing 'Eiffel Tower,' 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)


774
775
776
# File 'generated/google/apis/vision_v1/classes.rb', line 774

def confidence
  @confidence
end

#descriptionString

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

Returns:

  • (String)


727
728
729
# File 'generated/google/apis/vision_v1/classes.rb', line 727

def description
  @description
end

#localeString

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

Returns:

  • (String)


742
743
744
# File 'generated/google/apis/vision_v1/classes.rb', line 742

def locale
  @locale
end

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

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



767
768
769
# File 'generated/google/apis/vision_v1/classes.rb', line 767

def locations
  @locations
end

#midString

Opaque entity ID. Some IDs might be available in Knowledge Graph(KG). For more details on KG please see: https://developers.google.com/knowledge-graph/ Corresponds to the JSON property mid

Returns:

  • (String)


722
723
724
# File 'generated/google/apis/vision_v1/classes.rb', line 722

def mid
  @mid
end

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

Some entities can have additional optional Property fields. For example a different kind of score or string that qualifies the entity. Corresponds to the JSON property properties



748
749
750
# File 'generated/google/apis/vision_v1/classes.rb', line 748

def properties
  @properties
end

#scoreFloat

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

Returns:

  • (Float)


753
754
755
# File 'generated/google/apis/vision_v1/classes.rb', line 753

def score
  @score
end

#topicalityFloat

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

Returns:

  • (Float)


736
737
738
# File 'generated/google/apis/vision_v1/classes.rb', line 736

def topicality
  @topicality
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



781
782
783
784
785
786
787
788
789
790
791
# File 'generated/google/apis/vision_v1/classes.rb', line 781

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