google-cloud-vision 0.24.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bf4ace8e0a98ed237b81ff52efdcdc3df1e143a
4
- data.tar.gz: f17e4709edeb2c7a54e956bc79c6508d26cfe2f8
3
+ metadata.gz: 264c4bec187e3b7f07a1071352e54a7d41052349
4
+ data.tar.gz: 78d4f95902e26bd2d78d95e84cf0f8775fcc1d42
5
5
  SHA512:
6
- metadata.gz: 0e95f22f8d7ba1fbd4a5d99e1b24faec46e25421f4a936ea667b69ce6ee5c5f4a7166667a3131473c0ad626272e63bcd5b4a33d5ac6d679e0c774e88427e6a16
7
- data.tar.gz: dfcde1b68676679878eef8552fd7ce4e4210b42360e40bc95b4ff031b9a69bbff910785ef974d68f2b5c2a46422ca783fa271a1ff37bb3599fe92d7b897ec7c7
6
+ metadata.gz: 433215101554848c5ba0ea8f55a0ae6524772d61eedfca5087cf3053946bcf196b14046778833b2833d8bd57de04fdcfda8f2ed72c393c6247679c886b99d611
7
+ data.tar.gz: d3aae9451019ece567eacbc30e6b81bca5c2303e3afe648795ccdbad4ae796c89106a3b526e00f21631ece6fd7d262bec04e446651bca853618e2f0255716883
@@ -434,6 +434,96 @@ module Google
434
434
  annotation.web
435
435
  end
436
436
 
437
+ ##
438
+ # Performs detection of Cloud Vision
439
+ # [features](https://cloud.google.com/vision/reference/rest/v1/images/annotate#Feature)
440
+ # on the image. If no options for features are provided, **all** image
441
+ # detection features will be performed, with a default of `100` results
442
+ # for faces, landmarks, logos, labels, crop_hints, and web. If any
443
+ # feature option is provided, only the specified feature detections will
444
+ # be performed. Please review
445
+ # [Pricing](https://cloud.google.com/vision/docs/pricing) before use, as
446
+ # a separate charge is incurred for each feature performed on an image.
447
+ #
448
+ # @see https://cloud.google.com/vision/docs/requests-and-responses Cloud
449
+ # Vision API Requests and Responses
450
+ # @see https://cloud.google.com/vision/reference/rest/v1/images/annotate#AnnotateImageRequest
451
+ # AnnotateImageRequest
452
+ # @see https://cloud.google.com/vision/docs/pricing Cloud Vision Pricing
453
+ #
454
+ # @param [Boolean, Integer] faces Whether to perform the facial
455
+ # detection feature. The maximum number of results is configured in
456
+ # {Google::Cloud::Vision.default_max_faces}, or may be provided here.
457
+ # Optional.
458
+ # @param [Boolean, Integer] landmarks Whether to perform the landmark
459
+ # detection feature. The maximum number of results is configured in
460
+ # {Google::Cloud::Vision.default_max_landmarks}, or may be provided
461
+ # here. Optional.
462
+ # @param [Boolean, Integer] logos Whether to perform the logo detection
463
+ # feature. The maximum number of results is configured in
464
+ # {Google::Cloud::Vision.default_max_logos}, or may be provided here.
465
+ # Optional.
466
+ # @param [Boolean, Integer] labels Whether to perform the label
467
+ # detection feature. The maximum number of results is configured in
468
+ # {Google::Cloud::Vision.default_max_labels}, or may be provided here.
469
+ # Optional.
470
+ # @param [Boolean] text Whether to perform the text detection feature
471
+ # (OCR for shorter documents with sparse text). Optional.
472
+ # @param [Boolean] document Whether to perform the document text
473
+ # detection feature (OCR for longer documents with dense text).
474
+ # Optional.
475
+ # @param [Boolean] safe_search Whether to perform the safe search
476
+ # feature. Optional.
477
+ # @param [Boolean] properties Whether to perform the image properties
478
+ # feature (currently, the image's dominant colors.) Optional.
479
+ # @param [Boolean, Integer] crop_hints Whether to perform the crop hints
480
+ # feature. Optional.
481
+ # @param [Boolean, Integer] web Whether to perform the web annotation
482
+ # feature. Optional.
483
+ #
484
+ # @return [Annotation] The results for all image detections, returned as
485
+ # a single {Annotation} instance.
486
+ #
487
+ # @example
488
+ # require "google/cloud/vision"
489
+ #
490
+ # vision = Google::Cloud::Vision.new
491
+ #
492
+ # image = vision.image "path/to/landmark.jpg"
493
+ #
494
+ # annotation = image.annotate labels: true, landmarks: true
495
+ #
496
+ # annotation.labels.map &:description
497
+ # # ["stone carving", "ancient history", "statue", "sculpture",
498
+ # # "monument", "landmark"]
499
+ # annotation.landmarks.count #=> 1
500
+ #
501
+ # @example Maximum result values can also be provided:
502
+ # require "google/cloud/vision"
503
+ #
504
+ # vision = Google::Cloud::Vision.new
505
+ #
506
+ # image = vision.image "path/to/landmark.jpg"
507
+ #
508
+ # annotation = image.annotate labels: 3, landmarks: 3
509
+ #
510
+ # annotation.labels.map &:description
511
+ # # ["stone carving", "ancient history", "statue"]
512
+ # annotation.landmarks.count #=> 1
513
+ #
514
+ def annotate faces: false, landmarks: false, logos: false,
515
+ labels: false, text: false, document: false,
516
+ safe_search: false, properties: false, crop_hints: false,
517
+ web: false
518
+ @vision.annotate(self, faces: faces, landmarks: landmarks,
519
+ logos: logos, labels: labels, text: text,
520
+ document: document, safe_search: safe_search,
521
+ properties: properties, crop_hints: crop_hints,
522
+ web: web)
523
+ end
524
+ alias_method :mark, :annotate
525
+ alias_method :detect, :annotate
526
+
437
527
  # @private
438
528
  def to_s
439
529
  @to_s ||= begin
@@ -140,9 +140,9 @@ module Google
140
140
  # [features](https://cloud.google.com/vision/reference/rest/v1/images/annotate#Feature)
141
141
  # on the given image(s). If no options for features are provided,
142
142
  # **all** image detection features will be performed, with a default of
143
- # `100` results for faces, landmarks, logos, and labels. If any feature
144
- # option is provided, only the specified feature detections will be
145
- # performed. Please review
143
+ # `100` results for faces, landmarks, logos, labels, crop_hints, and
144
+ # web. If any feature option is provided, only the specified feature
145
+ # detections will be performed. Please review
146
146
  # [Pricing](https://cloud.google.com/vision/docs/pricing) before use, as
147
147
  # a separate charge is incurred for each feature performed on an image.
148
148
  #
@@ -6,9 +6,7 @@
6
6
  "DEADLINE_EXCEEDED",
7
7
  "UNAVAILABLE"
8
8
  ],
9
- "non_idempotent": [
10
- "UNAVAILABLE"
11
- ]
9
+ "non_idempotent": []
12
10
  },
13
11
  "retry_params": {
14
12
  "default": {
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Vision
19
- VERSION = "0.24.0"
19
+ VERSION = "0.25.0"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-vision
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-01 00:00:00.000000000 Z
12
+ date: 2017-07-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -211,7 +211,7 @@ files:
211
211
  - lib/google/cloud/vision/v1/text_annotation_pb.rb
212
212
  - lib/google/cloud/vision/v1/web_detection_pb.rb
213
213
  - lib/google/cloud/vision/version.rb
214
- homepage: http://googlecloudplatform.github.io/google-cloud-ruby/
214
+ homepage: https://github.com/GoogleCloudPlatform/google-cloud-ruby/tree/master/google-cloud-vision
215
215
  licenses:
216
216
  - Apache-2.0
217
217
  metadata: {}
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  version: '0'
232
232
  requirements: []
233
233
  rubyforge_project:
234
- rubygems_version: 2.6.11
234
+ rubygems_version: 2.6.12
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: API Client library for Google Cloud Vision API