Class: Azure::CognitiveServices::ImageSearch::V1_0::Models::ImageInsights

Inherits:
Response show all
Includes:
MsRestAzure
Defined in:
lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb

Overview

The top-level object that the response includes when an image insights request succeeds. For information about requesting image insights, see the [insightsToken](docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#insightstoken) query parameter. The modules query parameter affects the fields that Bing includes in the response. If you set [modules](docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#modulesrequested) to only Caption, then this object includes only the imageCaption field.

Instance Attribute Summary collapse

Attributes inherited from Response

#read_link, #web_search_url

Attributes inherited from Identifiable

#id

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeImageInsights

Returns a new instance of ImageInsights.



23
24
25
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 23

def initialize
  @_type = "ImageInsights"
end

Instance Attribute Details

#_typeObject

Returns the value of attribute _type.



27
28
29
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 27

def _type
  @_type
end

#best_representative_queryQuery

the link in the Query object, takes the user to a webpage with more pictures of the image.

Returns:

  • (Query)

    The query term that best represents the image. Clicking



38
39
40
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 38

def best_representative_query
  @best_representative_query
end

#image_captionImageInsightsImageCaption

Returns The caption to use for the image.

Returns:



41
42
43
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 41

def image_caption
  @image_caption
end

#image_insights_tokenString

Search API to get more information about the image. For information about using this token, see the insightsToken query parameter. This token has the same usage as the token in the Image object.

Returns:

  • (String)

    A token that you use in a subsequent call to the Image



33
34
35
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 33

def image_insights_token
  @image_insights_token
end

#image_tagsImageTagsModule

found in the image. For example, if the image is of a person, the tags might indicate the person’s gender and the type of clothes they’re wearing.

Returns:



91
92
93
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 91

def image_tags
  @image_tags
end

#pages_includingImagesModule

access the webpage, use the URL in the image’s hostPageUrl field.

Returns:

  • (ImagesModule)

    A list of webpages that contain the image. To



49
50
51
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 49

def pages_including
  @pages_including
end

#recipesRecipesModule

example, if the image is of an apple pie, the list contains recipes for making an apple pie.

Returns:

  • (RecipesModule)

    A list of recipes related to the image. For



63
64
65
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 63

def recipes
  @recipes
end

#recognized_entity_groupsRecognizedEntitiesModule

of entities that match the entity found in the specified image. For example, the response might include images from the general celebrity group if the entity was recognized in that group.

Returns:



85
86
87
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 85

def recognized_entity_groups
  @recognized_entity_groups
end

contain related images.

Returns:



45
46
47
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 45

def related_collections
  @related_collections
end

others.

Returns:



58
59
60
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 58

def related_searches
  @related_searches
end

#shopping_sourcesAggregateOffer

to the image. For example, if the image is of an apple pie, the list contains merchants that are selling apple pies.

Returns:



54
55
56
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 54

def shopping_sources
  @shopping_sources
end

#visually_similar_imagesImagesModule

the original image. For example, if the specified image is of a sunset over a body of water, the list of similar images are of a sunset over a body of water. If the specified image is of a person, similar images might be of the same person or they might be of persons dressed similarly or in a similar setting. The criteria for similarity continues to evolve.

Returns:

  • (ImagesModule)

    A list of images that are visually similar to



72
73
74
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 72

def visually_similar_images
  @visually_similar_images
end

#visually_similar_productsImagesModule

visually similar to products found in the original image. For example, if the specified image contains a dress, the list of similar images contain a dress. The image provides summary information about offers that Bing found online for the product.

Returns:

  • (ImagesModule)

    A list of images that contain products that are



79
80
81
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 79

def visually_similar_products
  @visually_similar_products
end

Class Method Details

.mapperObject

Mapper for ImageInsights class as Ruby Hash. This will be used for serialization/deserialization.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/1.0/generated/azure_cognitiveservices_imagesearch/models/image_insights.rb', line 98

def self.mapper()
  {
    client_side_validation: true,
    required: false,
    serialized_name: 'ImageInsights',
    type: {
      name: 'Composite',
      class_name: 'ImageInsights',
      model_properties: {
        _type: {
          client_side_validation: true,
          required: true,
          serialized_name: '_type',
          type: {
            name: 'String'
          }
        },
        id: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'id',
          type: {
            name: 'String'
          }
        },
        read_link: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'readLink',
          type: {
            name: 'String'
          }
        },
        web_search_url: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'webSearchUrl',
          type: {
            name: 'String'
          }
        },
        image_insights_token: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'imageInsightsToken',
          type: {
            name: 'String'
          }
        },
        best_representative_query: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'bestRepresentativeQuery',
          type: {
            name: 'Composite',
            class_name: 'Query'
          }
        },
        image_caption: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'imageCaption',
          type: {
            name: 'Composite',
            class_name: 'ImageInsightsImageCaption'
          }
        },
        related_collections: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'relatedCollections',
          type: {
            name: 'Composite',
            class_name: 'RelatedCollectionsModule'
          }
        },
        pages_including: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'pagesIncluding',
          type: {
            name: 'Composite',
            class_name: 'ImagesModule'
          }
        },
        shopping_sources: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'shoppingSources',
          type: {
            name: 'Composite',
            class_name: 'AggregateOffer'
          }
        },
        related_searches: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'relatedSearches',
          type: {
            name: 'Composite',
            class_name: 'RelatedSearchesModule'
          }
        },
        recipes: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'recipes',
          type: {
            name: 'Composite',
            class_name: 'RecipesModule'
          }
        },
        visually_similar_images: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'visuallySimilarImages',
          type: {
            name: 'Composite',
            class_name: 'ImagesModule'
          }
        },
        visually_similar_products: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'visuallySimilarProducts',
          type: {
            name: 'Composite',
            class_name: 'ImagesModule'
          }
        },
        recognized_entity_groups: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'recognizedEntityGroups',
          type: {
            name: 'Composite',
            class_name: 'RecognizedEntitiesModule'
          }
        },
        image_tags: {
          client_side_validation: true,
          required: false,
          read_only: true,
          serialized_name: 'imageTags',
          type: {
            name: 'Composite',
            class_name: 'ImageTagsModule'
          }
        }
      }
    }
  }
end