Class: Google::Apis::VisionV1::ReferenceImage

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

Overview

A ReferenceImage represents a product image and its associated metadata, such as bounding boxes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ReferenceImage

Returns a new instance of ReferenceImage.



9721
9722
9723
# File 'lib/google/apis/vision_v1/classes.rb', line 9721

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

Instance Attribute Details

#bounding_polysArray<Google::Apis::VisionV1::BoundingPoly>

Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). Corresponds to the JSON property boundingPolys



9706
9707
9708
# File 'lib/google/apis/vision_v1/classes.rb', line 9706

def bounding_polys
  @bounding_polys
end

#nameString

The resource name of the reference image. Format is: projects/PROJECT_ID/ locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID. This field is ignored when creating a reference image. Corresponds to the JSON property name

Returns:

  • (String)


9713
9714
9715
# File 'lib/google/apis/vision_v1/classes.rb', line 9713

def name
  @name
end

#uriString

Required. The Google Cloud Storage URI of the reference image. The URI must start with gs://. Corresponds to the JSON property uri

Returns:

  • (String)


9719
9720
9721
# File 'lib/google/apis/vision_v1/classes.rb', line 9719

def uri
  @uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9726
9727
9728
9729
9730
# File 'lib/google/apis/vision_v1/classes.rb', line 9726

def update!(**args)
  @bounding_polys = args[:bounding_polys] if args.key?(:bounding_polys)
  @name = args[:name] if args.key?(:name)
  @uri = args[:uri] if args.key?(:uri)
end