1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="vision_v1.html">Cloud Vision API</a> . <a href="vision_v1.projects.html">projects</a> . <a href="vision_v1.projects.locations.html">locations</a> . <a href="vision_v1.projects.locations.products.html">products</a> . <a href="vision_v1.projects.locations.products.referenceImages.html">referenceImages</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#create">create(parent, body, referenceImageId=None, x__xgafv=None)</a></code></p> 79<p class="firstline">Creates and returns a new ReferenceImage resource.</p> 80<p class="toc_element"> 81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> 82<p class="firstline">Permanently deletes a reference image.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(name, x__xgafv=None)</a></code></p> 85<p class="firstline">Gets information associated with a ReferenceImage.</p> 86<p class="toc_element"> 87 <code><a href="#list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> 88<p class="firstline">Lists reference images.</p> 89<p class="toc_element"> 90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 91<p class="firstline">Retrieves the next page of results.</p> 92<h3>Method Details</h3> 93<div class="method"> 94 <code class="details" id="create">create(parent, body, referenceImageId=None, x__xgafv=None)</code> 95 <pre>Creates and returns a new ReferenceImage resource. 96 97The `bounding_poly` field is optional. If `bounding_poly` is not specified, 98the system will try to detect regions of interest in the image that are 99compatible with the product_category on the parent product. If it is 100specified, detection is ALWAYS skipped. The system converts polygons into 101non-rotated rectangles. 102 103Note that the pipeline will resize the image if the image resolution is too 104large to process (above 50MP). 105 106Possible errors: 107 108* Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 109 characters. 110* Returns INVALID_ARGUMENT if the product does not exist. 111* Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing 112 compatible with the parent product's product_category is detected. 113* Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. 114 115Args: 116 parent: string, Resource name of the product in which to create the reference image. 117 118Format is 119`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. (required) 120 body: object, The request body. (required) 121 The object takes the form of: 122 123{ # A `ReferenceImage` represents a product image and its associated metadata, 124 # such as bounding boxes. 125 "boundingPolys": [ # Bounding polygons around the areas of interest in the reference image. 126 # Optional. If this field is empty, the system will try to detect regions of 127 # interest. At most 10 bounding polygons will be used. 128 # 129 # The provided shape is converted into a non-rotated rectangle. Once 130 # converted, the small edge of the rectangle must be greater than or equal 131 # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 132 # is not). 133 { # A bounding polygon for the detected image annotation. 134 "normalizedVertices": [ # The bounding polygon normalized vertices. 135 { # A vertex represents a 2D point in the image. 136 # NOTE: the normalized vertex coordinates are relative to the original image 137 # and range from 0 to 1. 138 "y": 3.14, # Y coordinate. 139 "x": 3.14, # X coordinate. 140 }, 141 ], 142 "vertices": [ # The bounding polygon vertices. 143 { # A vertex represents a 2D point in the image. 144 # NOTE: the vertex coordinates are in the same scale as the original image. 145 "y": 42, # Y coordinate. 146 "x": 42, # X coordinate. 147 }, 148 ], 149 }, 150 ], 151 "name": "A String", # The resource name of the reference image. 152 # 153 # Format is: 154 # 155 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. 156 # 157 # This field is ignored when creating a reference image. 158 "uri": "A String", # The Google Cloud Storage URI of the reference image. 159 # 160 # The URI must start with `gs://`. 161 # 162 # Required. 163 } 164 165 referenceImageId: string, A user-supplied resource id for the ReferenceImage to be added. If set, 166the server will attempt to use this value as the resource id. If it is 167already in use, an error is returned with code ALREADY_EXISTS. Must be at 168most 128 characters long. It cannot contain the character `/`. 169 x__xgafv: string, V1 error format. 170 Allowed values 171 1 - v1 error format 172 2 - v2 error format 173 174Returns: 175 An object of the form: 176 177 { # A `ReferenceImage` represents a product image and its associated metadata, 178 # such as bounding boxes. 179 "boundingPolys": [ # Bounding polygons around the areas of interest in the reference image. 180 # Optional. If this field is empty, the system will try to detect regions of 181 # interest. At most 10 bounding polygons will be used. 182 # 183 # The provided shape is converted into a non-rotated rectangle. Once 184 # converted, the small edge of the rectangle must be greater than or equal 185 # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 186 # is not). 187 { # A bounding polygon for the detected image annotation. 188 "normalizedVertices": [ # The bounding polygon normalized vertices. 189 { # A vertex represents a 2D point in the image. 190 # NOTE: the normalized vertex coordinates are relative to the original image 191 # and range from 0 to 1. 192 "y": 3.14, # Y coordinate. 193 "x": 3.14, # X coordinate. 194 }, 195 ], 196 "vertices": [ # The bounding polygon vertices. 197 { # A vertex represents a 2D point in the image. 198 # NOTE: the vertex coordinates are in the same scale as the original image. 199 "y": 42, # Y coordinate. 200 "x": 42, # X coordinate. 201 }, 202 ], 203 }, 204 ], 205 "name": "A String", # The resource name of the reference image. 206 # 207 # Format is: 208 # 209 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. 210 # 211 # This field is ignored when creating a reference image. 212 "uri": "A String", # The Google Cloud Storage URI of the reference image. 213 # 214 # The URI must start with `gs://`. 215 # 216 # Required. 217 }</pre> 218</div> 219 220<div class="method"> 221 <code class="details" id="delete">delete(name, x__xgafv=None)</code> 222 <pre>Permanently deletes a reference image. 223 224The image metadata will be deleted right away, but search queries 225against ProductSets containing the image may still work until all related 226caches are refreshed. 227 228The actual image files are not deleted from Google Cloud Storage. 229 230Args: 231 name: string, The resource name of the reference image to delete. 232 233Format is: 234 235`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` (required) 236 x__xgafv: string, V1 error format. 237 Allowed values 238 1 - v1 error format 239 2 - v2 error format 240 241Returns: 242 An object of the form: 243 244 { # A generic empty message that you can re-use to avoid defining duplicated 245 # empty messages in your APIs. A typical example is to use it as the request 246 # or the response type of an API method. For instance: 247 # 248 # service Foo { 249 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 250 # } 251 # 252 # The JSON representation for `Empty` is empty JSON object `{}`. 253 }</pre> 254</div> 255 256<div class="method"> 257 <code class="details" id="get">get(name, x__xgafv=None)</code> 258 <pre>Gets information associated with a ReferenceImage. 259 260Possible errors: 261 262* Returns NOT_FOUND if the specified image does not exist. 263 264Args: 265 name: string, The resource name of the ReferenceImage to get. 266 267Format is: 268 269`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. (required) 270 x__xgafv: string, V1 error format. 271 Allowed values 272 1 - v1 error format 273 2 - v2 error format 274 275Returns: 276 An object of the form: 277 278 { # A `ReferenceImage` represents a product image and its associated metadata, 279 # such as bounding boxes. 280 "boundingPolys": [ # Bounding polygons around the areas of interest in the reference image. 281 # Optional. If this field is empty, the system will try to detect regions of 282 # interest. At most 10 bounding polygons will be used. 283 # 284 # The provided shape is converted into a non-rotated rectangle. Once 285 # converted, the small edge of the rectangle must be greater than or equal 286 # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 287 # is not). 288 { # A bounding polygon for the detected image annotation. 289 "normalizedVertices": [ # The bounding polygon normalized vertices. 290 { # A vertex represents a 2D point in the image. 291 # NOTE: the normalized vertex coordinates are relative to the original image 292 # and range from 0 to 1. 293 "y": 3.14, # Y coordinate. 294 "x": 3.14, # X coordinate. 295 }, 296 ], 297 "vertices": [ # The bounding polygon vertices. 298 { # A vertex represents a 2D point in the image. 299 # NOTE: the vertex coordinates are in the same scale as the original image. 300 "y": 42, # Y coordinate. 301 "x": 42, # X coordinate. 302 }, 303 ], 304 }, 305 ], 306 "name": "A String", # The resource name of the reference image. 307 # 308 # Format is: 309 # 310 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. 311 # 312 # This field is ignored when creating a reference image. 313 "uri": "A String", # The Google Cloud Storage URI of the reference image. 314 # 315 # The URI must start with `gs://`. 316 # 317 # Required. 318 }</pre> 319</div> 320 321<div class="method"> 322 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, x__xgafv=None)</code> 323 <pre>Lists reference images. 324 325Possible errors: 326 327* Returns NOT_FOUND if the parent product does not exist. 328* Returns INVALID_ARGUMENT if the page_size is greater than 100, or less 329 than 1. 330 331Args: 332 parent: string, Resource name of the product containing the reference images. 333 334Format is 335`projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. (required) 336 pageSize: integer, The maximum number of items to return. Default 10, maximum 100. 337 pageToken: string, A token identifying a page of results to be returned. This is the value 338of `nextPageToken` returned in a previous reference image list request. 339 340Defaults to the first page if not specified. 341 x__xgafv: string, V1 error format. 342 Allowed values 343 1 - v1 error format 344 2 - v2 error format 345 346Returns: 347 An object of the form: 348 349 { # Response message for the `ListReferenceImages` method. 350 "nextPageToken": "A String", # The next_page_token returned from a previous List request, if any. 351 "pageSize": 42, # The maximum number of items to return. Default 10, maximum 100. 352 "referenceImages": [ # The list of reference images. 353 { # A `ReferenceImage` represents a product image and its associated metadata, 354 # such as bounding boxes. 355 "boundingPolys": [ # Bounding polygons around the areas of interest in the reference image. 356 # Optional. If this field is empty, the system will try to detect regions of 357 # interest. At most 10 bounding polygons will be used. 358 # 359 # The provided shape is converted into a non-rotated rectangle. Once 360 # converted, the small edge of the rectangle must be greater than or equal 361 # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 362 # is not). 363 { # A bounding polygon for the detected image annotation. 364 "normalizedVertices": [ # The bounding polygon normalized vertices. 365 { # A vertex represents a 2D point in the image. 366 # NOTE: the normalized vertex coordinates are relative to the original image 367 # and range from 0 to 1. 368 "y": 3.14, # Y coordinate. 369 "x": 3.14, # X coordinate. 370 }, 371 ], 372 "vertices": [ # The bounding polygon vertices. 373 { # A vertex represents a 2D point in the image. 374 # NOTE: the vertex coordinates are in the same scale as the original image. 375 "y": 42, # Y coordinate. 376 "x": 42, # X coordinate. 377 }, 378 ], 379 }, 380 ], 381 "name": "A String", # The resource name of the reference image. 382 # 383 # Format is: 384 # 385 # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. 386 # 387 # This field is ignored when creating a reference image. 388 "uri": "A String", # The Google Cloud Storage URI of the reference image. 389 # 390 # The URI must start with `gs://`. 391 # 392 # Required. 393 }, 394 ], 395 }</pre> 396</div> 397 398<div class="method"> 399 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 400 <pre>Retrieves the next page of results. 401 402Args: 403 previous_request: The request for the previous page. (required) 404 previous_response: The response from the request for the previous page. (required) 405 406Returns: 407 A request object that you can call 'execute()' on to request the next 408 page. Returns None if there are no more items in the collection. 409 </pre> 410</div> 411 412</body></html>