google-api-client 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/MIGRATING.md +22 -7
- data/README.md +4 -8
- data/api_names.yaml +1210 -37815
- data/generated/google/apis/acceleratedmobilepageurl_v1.rb +32 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/classes.rb +144 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/representations.rb +86 -0
- data/generated/google/apis/acceleratedmobilepageurl_v1/service.rb +90 -0
- data/generated/google/apis/adexchangebuyer2_v2beta1.rb +1 -1
- data/generated/google/apis/adexchangebuyer2_v2beta1/classes.rb +764 -764
- data/generated/google/apis/adexchangebuyer2_v2beta1/representations.rb +180 -180
- data/generated/google/apis/adexchangebuyer2_v2beta1/service.rb +421 -421
- data/generated/google/apis/adexchangebuyer_v1_4/classes.rb +1 -0
- data/generated/google/apis/admin_directory_v1/classes.rb +1 -0
- data/generated/google/apis/admin_reports_v1.rb +1 -1
- data/generated/google/apis/adsense_v1_4.rb +1 -1
- data/generated/google/apis/adsensehost_v4_1.rb +1 -1
- data/generated/google/apis/analyticsreporting_v4/classes.rb +187 -187
- data/generated/google/apis/analyticsreporting_v4/representations.rb +42 -42
- data/generated/google/apis/appengine_v1.rb +40 -0
- data/generated/google/apis/appengine_v1/classes.rb +2251 -0
- data/generated/google/apis/appengine_v1/representations.rb +858 -0
- data/generated/google/apis/appengine_v1/service.rb +894 -0
- data/generated/google/apis/bigquery_v2.rb +1 -1
- data/generated/google/apis/bigquery_v2/classes.rb +11 -6
- data/generated/google/apis/books_v1.rb +1 -1
- data/generated/google/apis/books_v1/classes.rb +26 -0
- data/generated/google/apis/books_v1/representations.rb +15 -0
- data/generated/google/apis/books_v1/service.rb +4 -1
- data/generated/google/apis/calendar_v3.rb +1 -1
- data/generated/google/apis/classroom_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1.rb +1 -1
- data/generated/google/apis/cloudbuild_v1/classes.rb +638 -637
- data/generated/google/apis/cloudbuild_v1/representations.rb +110 -110
- data/generated/google/apis/cloudbuild_v1/service.rb +139 -139
- data/generated/google/apis/clouddebugger_v2.rb +3 -3
- data/generated/google/apis/clouddebugger_v2/classes.rb +131 -131
- data/generated/google/apis/clouddebugger_v2/representations.rb +25 -25
- data/generated/google/apis/clouderrorreporting_v1beta1.rb +36 -0
- data/generated/google/apis/clouderrorreporting_v1beta1/classes.rb +590 -0
- data/generated/google/apis/clouderrorreporting_v1beta1/representations.rb +252 -0
- data/generated/google/apis/clouderrorreporting_v1beta1/service.rb +350 -0
- data/generated/google/apis/cloudfunctions_v1.rb +35 -0
- data/generated/google/apis/cloudfunctions_v1/classes.rb +98 -0
- data/generated/google/apis/cloudfunctions_v1/representations.rb +57 -0
- data/generated/google/apis/cloudfunctions_v1/service.rb +89 -0
- data/generated/google/apis/cloudkms_v1/classes.rb +277 -270
- data/generated/google/apis/cloudkms_v1/representations.rb +73 -73
- data/generated/google/apis/cloudkms_v1/service.rb +194 -194
- data/generated/google/apis/cloudresourcemanager_v1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1/classes.rb +1147 -1144
- data/generated/google/apis/cloudresourcemanager_v1/representations.rb +188 -188
- data/generated/google/apis/cloudresourcemanager_v1/service.rb +513 -936
- data/generated/google/apis/cloudresourcemanager_v1beta1.rb +1 -1
- data/generated/google/apis/cloudresourcemanager_v1beta1/classes.rb +307 -916
- data/generated/google/apis/cloudresourcemanager_v1beta1/representations.rb +63 -285
- data/generated/google/apis/cloudresourcemanager_v1beta1/service.rb +333 -681
- data/generated/google/apis/cloudtrace_v1/classes.rb +38 -38
- data/generated/google/apis/cloudtrace_v1/representations.rb +13 -13
- data/generated/google/apis/cloudtrace_v1/service.rb +16 -16
- data/generated/google/apis/compute_beta.rb +1 -1
- data/generated/google/apis/compute_beta/classes.rb +32 -7
- data/generated/google/apis/compute_beta/representations.rb +2 -0
- data/generated/google/apis/compute_beta/service.rb +11 -11
- data/generated/google/apis/compute_v1.rb +1 -1
- data/generated/google/apis/compute_v1/classes.rb +95 -2
- data/generated/google/apis/compute_v1/representations.rb +33 -0
- data/generated/google/apis/dataflow_v1b3/classes.rb +3333 -3333
- data/generated/google/apis/dataflow_v1b3/representations.rb +759 -759
- data/generated/google/apis/dataflow_v1b3/service.rb +154 -154
- data/generated/google/apis/dataproc_v1.rb +1 -1
- data/generated/google/apis/dataproc_v1/classes.rb +1097 -1097
- data/generated/google/apis/dataproc_v1/representations.rb +200 -200
- data/generated/google/apis/dataproc_v1/service.rb +356 -356
- data/generated/google/apis/datastore_v1.rb +4 -4
- data/generated/google/apis/datastore_v1/classes.rb +701 -690
- data/generated/google/apis/datastore_v1/representations.rb +160 -160
- data/generated/google/apis/datastore_v1/service.rb +52 -52
- data/generated/google/apis/deploymentmanager_v2/classes.rb +4 -0
- data/generated/google/apis/doubleclicksearch_v2.rb +1 -1
- data/generated/google/apis/drive_v2.rb +1 -1
- data/generated/google/apis/drive_v2/classes.rb +158 -35
- data/generated/google/apis/drive_v2/representations.rb +39 -0
- data/generated/google/apis/drive_v2/service.rb +4 -4
- data/generated/google/apis/drive_v3.rb +1 -1
- data/generated/google/apis/drive_v3/classes.rb +162 -33
- data/generated/google/apis/drive_v3/representations.rb +39 -0
- data/generated/google/apis/drive_v3/service.rb +4 -4
- data/generated/google/apis/firebasedynamiclinks_v1.rb +35 -0
- data/generated/google/apis/firebasedynamiclinks_v1/classes.rb +466 -0
- data/generated/google/apis/firebasedynamiclinks_v1/representations.rb +222 -0
- data/generated/google/apis/firebasedynamiclinks_v1/service.rb +95 -0
- data/generated/google/apis/firebaserules_v1.rb +41 -0
- data/generated/google/apis/firebaserules_v1/classes.rb +425 -0
- data/generated/google/apis/firebaserules_v1/representations.rb +222 -0
- data/generated/google/apis/firebaserules_v1/service.rb +495 -0
- data/generated/google/apis/games_v1/classes.rb +4 -0
- data/generated/google/apis/genomics_v1.rb +7 -7
- data/generated/google/apis/genomics_v1/classes.rb +2336 -2335
- data/generated/google/apis/genomics_v1/representations.rb +387 -387
- data/generated/google/apis/genomics_v1/service.rb +1187 -1187
- data/generated/google/apis/gmail_v1/classes.rb +3 -0
- data/generated/google/apis/iam_v1.rb +1 -1
- data/generated/google/apis/iam_v1/classes.rb +123 -117
- data/generated/google/apis/iam_v1/representations.rb +33 -33
- data/generated/google/apis/iam_v1/service.rb +109 -109
- data/generated/google/apis/identitytoolkit_v3/classes.rb +5 -0
- data/generated/google/apis/kgsearch_v1/classes.rb +6 -6
- data/generated/google/apis/kgsearch_v1/representations.rb +1 -1
- data/generated/google/apis/kgsearch_v1/service.rb +4 -4
- data/generated/google/apis/language_v1.rb +36 -0
- data/generated/google/apis/language_v1/classes.rb +757 -0
- data/generated/google/apis/language_v1/representations.rb +338 -0
- data/generated/google/apis/language_v1/service.rb +185 -0
- data/generated/google/apis/language_v1beta1/classes.rb +407 -407
- data/generated/google/apis/language_v1beta1/representations.rb +103 -103
- data/generated/google/apis/language_v1beta1/service.rb +45 -45
- data/generated/google/apis/logging_v2.rb +46 -0
- data/generated/google/apis/logging_v2/classes.rb +1271 -0
- data/generated/google/apis/logging_v2/representations.rb +421 -0
- data/generated/google/apis/logging_v2/service.rb +1569 -0
- data/generated/google/apis/logging_v2beta1.rb +1 -1
- data/generated/google/apis/logging_v2beta1/classes.rb +886 -886
- data/generated/google/apis/logging_v2beta1/representations.rb +132 -132
- data/generated/google/apis/logging_v2beta1/service.rb +235 -235
- data/generated/google/apis/manufacturers_v1/classes.rb +147 -147
- data/generated/google/apis/manufacturers_v1/representations.rb +29 -29
- data/generated/google/apis/ml_v1.rb +34 -0
- data/generated/google/apis/ml_v1/classes.rb +1617 -0
- data/generated/google/apis/ml_v1/representations.rb +498 -0
- data/generated/google/apis/ml_v1/service.rb +769 -0
- data/generated/google/apis/monitoring_v3.rb +4 -4
- data/generated/google/apis/monitoring_v3/classes.rb +630 -630
- data/generated/google/apis/monitoring_v3/representations.rb +134 -134
- data/generated/google/apis/monitoring_v3/service.rb +240 -240
- data/generated/google/apis/pagespeedonline_v2/classes.rb +1 -0
- data/generated/google/apis/partners_v2.rb +1 -1
- data/generated/google/apis/partners_v2/classes.rb +639 -639
- data/generated/google/apis/partners_v2/representations.rb +168 -168
- data/generated/google/apis/partners_v2/service.rb +381 -381
- data/generated/google/apis/people_v1.rb +10 -10
- data/generated/google/apis/people_v1/classes.rb +524 -524
- data/generated/google/apis/people_v1/representations.rb +143 -143
- data/generated/google/apis/people_v1/service.rb +30 -30
- data/generated/google/apis/plus_domains_v1.rb +1 -1
- data/generated/google/apis/plus_v1.rb +1 -1
- data/generated/google/apis/proximitybeacon_v1beta1/classes.rb +454 -444
- data/generated/google/apis/proximitybeacon_v1beta1/representations.rb +90 -90
- data/generated/google/apis/proximitybeacon_v1beta1/service.rb +110 -110
- data/generated/google/apis/pubsub_v1/classes.rb +175 -173
- data/generated/google/apis/pubsub_v1/representations.rb +53 -53
- data/generated/google/apis/pubsub_v1/service.rb +210 -210
- data/generated/google/apis/replicapool_v1beta2/classes.rb +2 -0
- data/generated/google/apis/runtimeconfig_v1.rb +38 -0
- data/generated/google/apis/runtimeconfig_v1/classes.rb +252 -0
- data/generated/google/apis/runtimeconfig_v1/representations.rb +98 -0
- data/generated/google/apis/runtimeconfig_v1/service.rb +176 -0
- data/generated/google/apis/script_v1.rb +1 -1
- data/generated/google/apis/script_v1/classes.rb +6 -6
- data/generated/google/apis/script_v1/representations.rb +1 -1
- data/generated/google/apis/searchconsole_v1.rb +31 -0
- data/generated/google/apis/searchconsole_v1/classes.rb +205 -0
- data/generated/google/apis/searchconsole_v1/representations.rb +129 -0
- data/generated/google/apis/searchconsole_v1/service.rb +88 -0
- data/generated/google/apis/servicecontrol_v1.rb +38 -0
- data/generated/google/apis/servicecontrol_v1/classes.rb +1675 -0
- data/generated/google/apis/servicecontrol_v1/representations.rb +601 -0
- data/generated/google/apis/servicecontrol_v1/service.rb +337 -0
- data/generated/google/apis/servicemanagement_v1.rb +45 -0
- data/generated/google/apis/servicemanagement_v1/classes.rb +4934 -0
- data/generated/google/apis/servicemanagement_v1/representations.rb +1526 -0
- data/generated/google/apis/servicemanagement_v1/service.rb +860 -0
- data/generated/google/apis/serviceuser_v1.rb +42 -0
- data/generated/google/apis/serviceuser_v1/classes.rb +3746 -0
- data/generated/google/apis/serviceuser_v1/representations.rb +1041 -0
- data/generated/google/apis/serviceuser_v1/service.rb +214 -0
- data/generated/google/apis/sheets_v4.rb +3 -3
- data/generated/google/apis/sheets_v4/classes.rb +4390 -4390
- data/generated/google/apis/sheets_v4/representations.rb +381 -381
- data/generated/google/apis/sheets_v4/service.rb +48 -48
- data/generated/google/apis/slides_v1.rb +3 -3
- data/generated/google/apis/slides_v1/classes.rb +2860 -2860
- data/generated/google/apis/slides_v1/representations.rb +693 -693
- data/generated/google/apis/slides_v1/service.rb +30 -30
- data/generated/google/apis/sourcerepo_v1.rb +34 -0
- data/generated/google/apis/sourcerepo_v1/classes.rb +687 -0
- data/generated/google/apis/sourcerepo_v1/representations.rb +285 -0
- data/generated/google/apis/sourcerepo_v1/service.rb +291 -0
- data/generated/google/apis/spanner_v1.rb +35 -0
- data/generated/google/apis/spanner_v1/classes.rb +3294 -0
- data/generated/google/apis/spanner_v1/representations.rb +984 -0
- data/generated/google/apis/spanner_v1/service.rb +1504 -0
- data/generated/google/apis/speech_v1beta1.rb +1 -1
- data/generated/google/apis/speech_v1beta1/classes.rb +197 -196
- data/generated/google/apis/speech_v1beta1/representations.rb +53 -53
- data/generated/google/apis/speech_v1beta1/service.rb +27 -27
- data/generated/google/apis/storage_v1.rb +1 -1
- data/generated/google/apis/storage_v1/classes.rb +131 -0
- data/generated/google/apis/storage_v1/representations.rb +51 -0
- data/generated/google/apis/storage_v1/service.rb +182 -0
- data/generated/google/apis/storagetransfer_v1.rb +1 -1
- data/generated/google/apis/storagetransfer_v1/classes.rb +732 -661
- data/generated/google/apis/storagetransfer_v1/representations.rb +132 -132
- data/generated/google/apis/storagetransfer_v1/service.rb +174 -197
- data/generated/google/apis/surveys_v2.rb +40 -0
- data/generated/google/apis/surveys_v2/classes.rb +806 -0
- data/generated/google/apis/surveys_v2/representations.rb +347 -0
- data/generated/google/apis/surveys_v2/service.rb +477 -0
- data/generated/google/apis/tagmanager_v2.rb +52 -0
- data/generated/google/apis/tagmanager_v2/classes.rb +2435 -0
- data/generated/google/apis/tagmanager_v2/representations.rb +993 -0
- data/generated/google/apis/tagmanager_v2/service.rb +2865 -0
- data/generated/google/apis/toolresults_v1beta3.rb +34 -0
- data/generated/google/apis/toolresults_v1beta3/classes.rb +2160 -0
- data/generated/google/apis/toolresults_v1beta3/representations.rb +729 -0
- data/generated/google/apis/toolresults_v1beta3/service.rb +1236 -0
- data/generated/google/apis/tracing_v1.rb +40 -0
- data/generated/google/apis/tracing_v1/classes.rb +664 -0
- data/generated/google/apis/tracing_v1/representations.rb +279 -0
- data/generated/google/apis/tracing_v1/service.rb +225 -0
- data/generated/google/apis/vision_v1.rb +1 -1
- data/generated/google/apis/vision_v1/classes.rb +1223 -1222
- data/generated/google/apis/vision_v1/representations.rb +234 -234
- data/generated/google/apis/vision_v1/service.rb +10 -10
- data/generated/google/apis/webfonts_v1.rb +33 -0
- data/generated/google/apis/webfonts_v1/classes.rb +113 -0
- data/generated/google/apis/webfonts_v1/representations.rb +62 -0
- data/generated/google/apis/webfonts_v1/service.rb +102 -0
- data/generated/google/apis/youtube_analytics_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1.rb +1 -1
- data/generated/google/apis/youtube_partner_v1/classes.rb +31 -0
- data/generated/google/apis/youtube_partner_v1/representations.rb +6 -0
- data/generated/google/apis/youtube_partner_v1/service.rb +41 -0
- data/generated/google/apis/youtube_v3/classes.rb +1 -0
- data/generated/google/apis/youtubereporting_v1.rb +4 -4
- data/generated/google/apis/youtubereporting_v1/classes.rb +76 -76
- data/generated/google/apis/youtubereporting_v1/representations.rb +25 -25
- data/generated/google/apis/youtubereporting_v1/service.rb +95 -95
- data/lib/google/apis/generator/annotator.rb +5 -4
- data/lib/google/apis/generator/templates/_class.tmpl +3 -0
- data/lib/google/apis/version.rb +1 -1
- data/samples/cli/lib/samples/adsense.rb +99 -0
- data/samples/cli/lib/samples/analytics.rb +18 -0
- data/samples/cli/lib/samples/gmail.rb +33 -0
- data/samples/cli/lib/samples/vision.rb +69 -0
- metadata +89 -4
- data/sync.rb +0 -71
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
# @see https://cloud.google.com/vision/
|
28
28
|
module VisionV1
|
29
29
|
VERSION = 'V1'
|
30
|
-
REVISION = '
|
30
|
+
REVISION = '20170328'
|
31
31
|
|
32
32
|
# View and manage your data across Google Cloud Platform services
|
33
33
|
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
@@ -22,25 +22,53 @@ module Google
|
|
22
22
|
module Apis
|
23
23
|
module VisionV1
|
24
24
|
|
25
|
-
#
|
26
|
-
|
27
|
-
class AnnotateImageRequest
|
25
|
+
# Parameters for crop hints annotation request.
|
26
|
+
class CropHintsParams
|
28
27
|
include Google::Apis::Core::Hashable
|
29
28
|
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
|
29
|
+
# Aspect ratios in floats, representing the ratio of the width to the height
|
30
|
+
# of the image. For example, if the desired aspect ratio is 4/3, the
|
31
|
+
# corresponding float value should be 1.33333. If not specified, the
|
32
|
+
# best possible crop is returned. The number of provided aspect ratios is
|
33
|
+
# limited to a maximum of 16; any aspect ratios provided after the 16th are
|
34
|
+
# ignored.
|
35
|
+
# Corresponds to the JSON property `aspectRatios`
|
36
|
+
# @return [Array<Float>]
|
37
|
+
attr_accessor :aspect_ratios
|
34
38
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
attr_accessor :features
|
39
|
+
def initialize(**args)
|
40
|
+
update!(**args)
|
41
|
+
end
|
39
42
|
|
40
|
-
#
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
# Update properties of this object
|
44
|
+
def update!(**args)
|
45
|
+
@aspect_ratios = args[:aspect_ratios] if args.key?(:aspect_ratios)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Logical element on the page.
|
50
|
+
class Block
|
51
|
+
include Google::Apis::Core::Hashable
|
52
|
+
|
53
|
+
# Additional information detected on the structural component.
|
54
|
+
# Corresponds to the JSON property `property`
|
55
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
56
|
+
attr_accessor :property
|
57
|
+
|
58
|
+
# Detected block type (text, image etc) for this block.
|
59
|
+
# Corresponds to the JSON property `blockType`
|
60
|
+
# @return [String]
|
61
|
+
attr_accessor :block_type
|
62
|
+
|
63
|
+
# A bounding polygon for the detected image annotation.
|
64
|
+
# Corresponds to the JSON property `boundingBox`
|
65
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
66
|
+
attr_accessor :bounding_box
|
67
|
+
|
68
|
+
# List of paragraphs in this block (if this blocks is of type text).
|
69
|
+
# Corresponds to the JSON property `paragraphs`
|
70
|
+
# @return [Array<Google::Apis::VisionV1::Paragraph>]
|
71
|
+
attr_accessor :paragraphs
|
44
72
|
|
45
73
|
def initialize(**args)
|
46
74
|
update!(**args)
|
@@ -48,71 +76,31 @@ module Google
|
|
48
76
|
|
49
77
|
# Update properties of this object
|
50
78
|
def update!(**args)
|
51
|
-
@
|
52
|
-
@
|
53
|
-
@
|
79
|
+
@property = args[:property] if args.key?(:property)
|
80
|
+
@block_type = args[:block_type] if args.key?(:block_type)
|
81
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
82
|
+
@paragraphs = args[:paragraphs] if args.key?(:paragraphs)
|
54
83
|
end
|
55
84
|
end
|
56
85
|
|
57
|
-
#
|
58
|
-
|
59
|
-
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
60
|
-
# - Simple to use and understand for most users
|
61
|
-
# - Flexible enough to meet unexpected needs
|
62
|
-
# # Overview
|
63
|
-
# The `Status` message contains three pieces of data: error code, error message,
|
64
|
-
# and error details. The error code should be an enum value of
|
65
|
-
# google.rpc.Code, but it may accept additional error codes if needed. The
|
66
|
-
# error message should be a developer-facing English message that helps
|
67
|
-
# developers *understand* and *resolve* the error. If a localized user-facing
|
68
|
-
# error message is needed, put the localized message in the error details or
|
69
|
-
# localize it in the client. The optional error details may contain arbitrary
|
70
|
-
# information about the error. There is a predefined set of error detail types
|
71
|
-
# in the package `google.rpc` which can be used for common error conditions.
|
72
|
-
# # Language mapping
|
73
|
-
# The `Status` message is the logical representation of the error model, but it
|
74
|
-
# is not necessarily the actual wire format. When the `Status` message is
|
75
|
-
# exposed in different client libraries and different wire protocols, it can be
|
76
|
-
# mapped differently. For example, it will likely be mapped to some exceptions
|
77
|
-
# in Java, but more likely mapped to some error codes in C.
|
78
|
-
# # Other uses
|
79
|
-
# The error model and the `Status` message can be used in a variety of
|
80
|
-
# environments, either with or without APIs, to provide a
|
81
|
-
# consistent developer experience across different environments.
|
82
|
-
# Example uses of this error model include:
|
83
|
-
# - Partial errors. If a service needs to return partial errors to the client,
|
84
|
-
# it may embed the `Status` in the normal response to indicate the partial
|
85
|
-
# errors.
|
86
|
-
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
87
|
-
# have a `Status` message for error reporting purpose.
|
88
|
-
# - Batch operations. If a client uses batch request and batch response, the
|
89
|
-
# `Status` message should be used directly inside batch response, one for
|
90
|
-
# each error sub-response.
|
91
|
-
# - Asynchronous operations. If an API call embeds asynchronous operation
|
92
|
-
# results in its response, the status of those operations should be
|
93
|
-
# represented directly using the `Status` message.
|
94
|
-
# - Logging. If some API errors are stored in logs, the message `Status` could
|
95
|
-
# be used directly after any stripping needed for security/privacy reasons.
|
96
|
-
class Status
|
86
|
+
# A `Property` consists of a user-supplied name/value pair.
|
87
|
+
class Property
|
97
88
|
include Google::Apis::Core::Hashable
|
98
89
|
|
99
|
-
#
|
100
|
-
# Corresponds to the JSON property `
|
101
|
-
# @return [
|
102
|
-
attr_accessor :
|
90
|
+
# Value of the property.
|
91
|
+
# Corresponds to the JSON property `value`
|
92
|
+
# @return [String]
|
93
|
+
attr_accessor :value
|
103
94
|
|
104
|
-
#
|
105
|
-
#
|
106
|
-
# google.rpc.Status.details field, or localized by the client.
|
107
|
-
# Corresponds to the JSON property `message`
|
95
|
+
# Value of numeric properties.
|
96
|
+
# Corresponds to the JSON property `uint64Value`
|
108
97
|
# @return [String]
|
109
|
-
attr_accessor :
|
98
|
+
attr_accessor :uint64_value
|
110
99
|
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
|
115
|
-
attr_accessor :details
|
100
|
+
# Name of the property.
|
101
|
+
# Corresponds to the JSON property `name`
|
102
|
+
# @return [String]
|
103
|
+
attr_accessor :name
|
116
104
|
|
117
105
|
def initialize(**args)
|
118
106
|
update!(**args)
|
@@ -120,14 +108,14 @@ module Google
|
|
120
108
|
|
121
109
|
# Update properties of this object
|
122
110
|
def update!(**args)
|
123
|
-
@
|
124
|
-
@
|
125
|
-
@
|
111
|
+
@value = args[:value] if args.key?(:value)
|
112
|
+
@uint64_value = args[:uint64_value] if args.key?(:uint64_value)
|
113
|
+
@name = args[:name] if args.key?(:name)
|
126
114
|
end
|
127
115
|
end
|
128
116
|
|
129
|
-
#
|
130
|
-
class
|
117
|
+
# Detected entity location information.
|
118
|
+
class LocationInfo
|
131
119
|
include Google::Apis::Core::Hashable
|
132
120
|
|
133
121
|
# An object representing a latitude/longitude pair. This is expressed as a pair
|
@@ -167,50 +155,9 @@ module Google
|
|
167
155
|
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
168
156
|
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
169
157
|
# as if it were annotated as ST_LOCATION.
|
170
|
-
# Corresponds to the JSON property `
|
171
|
-
# @return [Google::Apis::VisionV1::LatLng]
|
172
|
-
attr_accessor :min_lat_lng
|
173
|
-
|
174
|
-
# An object representing a latitude/longitude pair. This is expressed as a pair
|
175
|
-
# of doubles representing degrees latitude and degrees longitude. Unless
|
176
|
-
# specified otherwise, this must conform to the
|
177
|
-
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
178
|
-
# standard</a>. Values must be within normalized ranges.
|
179
|
-
# Example of normalization code in Python:
|
180
|
-
# def NormalizeLongitude(longitude):
|
181
|
-
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
182
|
-
# q, r = divmod(longitude, 360.0)
|
183
|
-
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
184
|
-
# return r - 360.0
|
185
|
-
# return r
|
186
|
-
# def NormalizeLatLng(latitude, longitude):
|
187
|
-
# """Wraps decimal degrees latitude and longitude to
|
188
|
-
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
189
|
-
# r = latitude % 360.0
|
190
|
-
# if r <= 90.0:
|
191
|
-
# return r, NormalizeLongitude(longitude)
|
192
|
-
# elif r >= 270.0:
|
193
|
-
# return r - 360, NormalizeLongitude(longitude)
|
194
|
-
# else:
|
195
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
196
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
197
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
198
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
199
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
200
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
201
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
202
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
203
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
204
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
205
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
206
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
207
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
208
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
209
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
210
|
-
# as if it were annotated as ST_LOCATION.
|
211
|
-
# Corresponds to the JSON property `maxLatLng`
|
158
|
+
# Corresponds to the JSON property `latLng`
|
212
159
|
# @return [Google::Apis::VisionV1::LatLng]
|
213
|
-
attr_accessor :
|
160
|
+
attr_accessor :lat_lng
|
214
161
|
|
215
162
|
def initialize(**args)
|
216
163
|
update!(**args)
|
@@ -218,29 +165,37 @@ module Google
|
|
218
165
|
|
219
166
|
# Update properties of this object
|
220
167
|
def update!(**args)
|
221
|
-
@
|
222
|
-
@max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
|
168
|
+
@lat_lng = args[:lat_lng] if args.key?(:lat_lng)
|
223
169
|
end
|
224
170
|
end
|
225
171
|
|
226
|
-
#
|
227
|
-
class
|
172
|
+
# External image source (Google Cloud Storage image location).
|
173
|
+
class ImageSource
|
228
174
|
include Google::Apis::Core::Hashable
|
229
175
|
|
230
|
-
#
|
231
|
-
#
|
176
|
+
# NOTE: For new code `image_uri` below is preferred.
|
177
|
+
# Google Cloud Storage image URI, which must be in the following form:
|
178
|
+
# `gs://bucket_name/object_name` (for details, see
|
179
|
+
# [Google Cloud Storage Request
|
180
|
+
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
181
|
+
# NOTE: Cloud Storage object versioning is not supported.
|
182
|
+
# Corresponds to the JSON property `gcsImageUri`
|
232
183
|
# @return [String]
|
233
|
-
attr_accessor :
|
234
|
-
|
235
|
-
# Additional information detected on the structural component.
|
236
|
-
# Corresponds to the JSON property `property`
|
237
|
-
# @return [Google::Apis::VisionV1::TextProperty]
|
238
|
-
attr_accessor :property
|
184
|
+
attr_accessor :gcs_image_uri
|
239
185
|
|
240
|
-
#
|
241
|
-
#
|
242
|
-
#
|
243
|
-
|
186
|
+
# Image URI which supports:
|
187
|
+
# 1) Google Cloud Storage image URI, which must be in the following form:
|
188
|
+
# `gs://bucket_name/object_name` (for details, see
|
189
|
+
# [Google Cloud Storage Request
|
190
|
+
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
191
|
+
# NOTE: Cloud Storage object versioning is not supported.
|
192
|
+
# 2) Publicly accessible image HTTP/HTTPS URL.
|
193
|
+
# This is preferred over the legacy `gcs_image_uri` above. When both
|
194
|
+
# `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
|
195
|
+
# precedence.
|
196
|
+
# Corresponds to the JSON property `imageUri`
|
197
|
+
# @return [String]
|
198
|
+
attr_accessor :image_uri
|
244
199
|
|
245
200
|
def initialize(**args)
|
246
201
|
update!(**args)
|
@@ -248,20 +203,19 @@ module Google
|
|
248
203
|
|
249
204
|
# Update properties of this object
|
250
205
|
def update!(**args)
|
251
|
-
@
|
252
|
-
@
|
253
|
-
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
206
|
+
@gcs_image_uri = args[:gcs_image_uri] if args.key?(:gcs_image_uri)
|
207
|
+
@image_uri = args[:image_uri] if args.key?(:image_uri)
|
254
208
|
end
|
255
209
|
end
|
256
210
|
|
257
|
-
#
|
258
|
-
class
|
211
|
+
# Response to a batch image annotation request.
|
212
|
+
class BatchAnnotateImagesResponse
|
259
213
|
include Google::Apis::Core::Hashable
|
260
214
|
|
261
|
-
#
|
262
|
-
# Corresponds to the JSON property `
|
263
|
-
# @return [Array<Google::Apis::VisionV1::
|
264
|
-
attr_accessor :
|
215
|
+
# Individual responses to image annotation requests within the batch.
|
216
|
+
# Corresponds to the JSON property `responses`
|
217
|
+
# @return [Array<Google::Apis::VisionV1::AnnotateImageResponse>]
|
218
|
+
attr_accessor :responses
|
265
219
|
|
266
220
|
def initialize(**args)
|
267
221
|
update!(**args)
|
@@ -269,59 +223,42 @@ module Google
|
|
269
223
|
|
270
224
|
# Update properties of this object
|
271
225
|
def update!(**args)
|
272
|
-
@
|
226
|
+
@responses = args[:responses] if args.key?(:responses)
|
273
227
|
end
|
274
228
|
end
|
275
229
|
|
276
|
-
#
|
277
|
-
|
278
|
-
# specified otherwise, this must conform to the
|
279
|
-
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
280
|
-
# standard</a>. Values must be within normalized ranges.
|
281
|
-
# Example of normalization code in Python:
|
282
|
-
# def NormalizeLongitude(longitude):
|
283
|
-
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
284
|
-
# q, r = divmod(longitude, 360.0)
|
285
|
-
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
286
|
-
# return r - 360.0
|
287
|
-
# return r
|
288
|
-
# def NormalizeLatLng(latitude, longitude):
|
289
|
-
# """Wraps decimal degrees latitude and longitude to
|
290
|
-
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
291
|
-
# r = latitude % 360.0
|
292
|
-
# if r <= 90.0:
|
293
|
-
# return r, NormalizeLongitude(longitude)
|
294
|
-
# elif r >= 270.0:
|
295
|
-
# return r - 360, NormalizeLongitude(longitude)
|
296
|
-
# else:
|
297
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
298
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
299
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
300
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
301
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
302
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
303
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
304
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
305
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
306
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
307
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
308
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
309
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
310
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
311
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
312
|
-
# as if it were annotated as ST_LOCATION.
|
313
|
-
class LatLng
|
230
|
+
# Relevant information for the image from the Internet.
|
231
|
+
class WebDetection
|
314
232
|
include Google::Apis::Core::Hashable
|
315
233
|
|
316
|
-
#
|
317
|
-
#
|
318
|
-
#
|
319
|
-
|
234
|
+
# Fully matching images from the Internet.
|
235
|
+
# They're definite neardups and most often a copy of the query image with
|
236
|
+
# merely a size change.
|
237
|
+
# Corresponds to the JSON property `fullMatchingImages`
|
238
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
239
|
+
attr_accessor :full_matching_images
|
320
240
|
|
321
|
-
#
|
322
|
-
# Corresponds to the JSON property `
|
323
|
-
# @return [
|
324
|
-
attr_accessor :
|
241
|
+
# Deduced entities from similar images on the Internet.
|
242
|
+
# Corresponds to the JSON property `webEntities`
|
243
|
+
# @return [Array<Google::Apis::VisionV1::WebEntity>]
|
244
|
+
attr_accessor :web_entities
|
245
|
+
|
246
|
+
# Web pages containing the matching images from the Internet.
|
247
|
+
# Corresponds to the JSON property `pagesWithMatchingImages`
|
248
|
+
# @return [Array<Google::Apis::VisionV1::WebPage>]
|
249
|
+
attr_accessor :pages_with_matching_images
|
250
|
+
|
251
|
+
# Partial matching images from the Internet.
|
252
|
+
# Those images are similar enough to share some key-point features. For
|
253
|
+
# example an original image will likely have partial matching for its crops.
|
254
|
+
# Corresponds to the JSON property `partialMatchingImages`
|
255
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
256
|
+
attr_accessor :partial_matching_images
|
257
|
+
|
258
|
+
# The visually similar image results.
|
259
|
+
# Corresponds to the JSON property `visuallySimilarImages`
|
260
|
+
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
261
|
+
attr_accessor :visually_similar_images
|
325
262
|
|
326
263
|
def initialize(**args)
|
327
264
|
update!(**args)
|
@@ -329,162 +266,34 @@ module Google
|
|
329
266
|
|
330
267
|
# Update properties of this object
|
331
268
|
def update!(**args)
|
332
|
-
@
|
333
|
-
@
|
269
|
+
@full_matching_images = args[:full_matching_images] if args.key?(:full_matching_images)
|
270
|
+
@web_entities = args[:web_entities] if args.key?(:web_entities)
|
271
|
+
@pages_with_matching_images = args[:pages_with_matching_images] if args.key?(:pages_with_matching_images)
|
272
|
+
@partial_matching_images = args[:partial_matching_images] if args.key?(:partial_matching_images)
|
273
|
+
@visually_similar_images = args[:visually_similar_images] if args.key?(:visually_similar_images)
|
334
274
|
end
|
335
275
|
end
|
336
276
|
|
337
|
-
#
|
338
|
-
#
|
339
|
-
#
|
340
|
-
|
341
|
-
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
342
|
-
# method in iOS; and, with just a little work, it can be easily formatted into
|
343
|
-
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
344
|
-
# Example (Java):
|
345
|
-
# import com.google.type.Color;
|
346
|
-
# // ...
|
347
|
-
# public static java.awt.Color fromProto(Color protocolor) `
|
348
|
-
# float alpha = protocolor.hasAlpha()
|
349
|
-
# ? protocolor.getAlpha().getValue()
|
350
|
-
# : 1.0;
|
351
|
-
# return new java.awt.Color(
|
352
|
-
# protocolor.getRed(),
|
353
|
-
# protocolor.getGreen(),
|
354
|
-
# protocolor.getBlue(),
|
355
|
-
# alpha);
|
356
|
-
# `
|
357
|
-
# public static Color toProto(java.awt.Color color) `
|
358
|
-
# float red = (float) color.getRed();
|
359
|
-
# float green = (float) color.getGreen();
|
360
|
-
# float blue = (float) color.getBlue();
|
361
|
-
# float denominator = 255.0;
|
362
|
-
# Color.Builder resultBuilder =
|
363
|
-
# Color
|
364
|
-
# .newBuilder()
|
365
|
-
# .setRed(red / denominator)
|
366
|
-
# .setGreen(green / denominator)
|
367
|
-
# .setBlue(blue / denominator);
|
368
|
-
# int alpha = color.getAlpha();
|
369
|
-
# if (alpha != 255) `
|
370
|
-
# result.setAlpha(
|
371
|
-
# FloatValue
|
372
|
-
# .newBuilder()
|
373
|
-
# .setValue(((float) alpha) / denominator)
|
374
|
-
# .build());
|
375
|
-
# `
|
376
|
-
# return resultBuilder.build();
|
377
|
-
# `
|
378
|
-
# // ...
|
379
|
-
# Example (iOS / Obj-C):
|
380
|
-
# // ...
|
381
|
-
# static UIColor* fromProto(Color* protocolor) `
|
382
|
-
# float red = [protocolor red];
|
383
|
-
# float green = [protocolor green];
|
384
|
-
# float blue = [protocolor blue];
|
385
|
-
# FloatValue* alpha_wrapper = [protocolor alpha];
|
386
|
-
# float alpha = 1.0;
|
387
|
-
# if (alpha_wrapper != nil) `
|
388
|
-
# alpha = [alpha_wrapper value];
|
389
|
-
# `
|
390
|
-
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
391
|
-
# `
|
392
|
-
# static Color* toProto(UIColor* color) `
|
393
|
-
# CGFloat red, green, blue, alpha;
|
394
|
-
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
395
|
-
# return nil;
|
396
|
-
# `
|
397
|
-
# Color* result = [Color alloc] init];
|
398
|
-
# [result setRed:red];
|
399
|
-
# [result setGreen:green];
|
400
|
-
# [result setBlue:blue];
|
401
|
-
# if (alpha <= 0.9999) `
|
402
|
-
# [result setAlpha:floatWrapperWithValue(alpha)];
|
403
|
-
# `
|
404
|
-
# [result autorelease];
|
405
|
-
# return result;
|
406
|
-
# `
|
407
|
-
# // ...
|
408
|
-
# Example (JavaScript):
|
409
|
-
# // ...
|
410
|
-
# var protoToCssColor = function(rgb_color) `
|
411
|
-
# var redFrac = rgb_color.red || 0.0;
|
412
|
-
# var greenFrac = rgb_color.green || 0.0;
|
413
|
-
# var blueFrac = rgb_color.blue || 0.0;
|
414
|
-
# var red = Math.floor(redFrac * 255);
|
415
|
-
# var green = Math.floor(greenFrac * 255);
|
416
|
-
# var blue = Math.floor(blueFrac * 255);
|
417
|
-
# if (!('alpha' in rgb_color)) `
|
418
|
-
# return rgbToCssColor_(red, green, blue);
|
419
|
-
# `
|
420
|
-
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
421
|
-
# var rgbParams = [red, green, blue].join(',');
|
422
|
-
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
423
|
-
# `;
|
424
|
-
# var rgbToCssColor_ = function(red, green, blue) `
|
425
|
-
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
426
|
-
# var hexString = rgbNumber.toString(16);
|
427
|
-
# var missingZeros = 6 - hexString.length;
|
428
|
-
# var resultBuilder = ['#'];
|
429
|
-
# for (var i = 0; i < missingZeros; i++) `
|
430
|
-
# resultBuilder.push('0');
|
431
|
-
# `
|
432
|
-
# resultBuilder.push(hexString);
|
433
|
-
# return resultBuilder.join('');
|
434
|
-
# `;
|
435
|
-
# // ...
|
436
|
-
class Color
|
277
|
+
# A 3D position in the image, used primarily for Face detection landmarks.
|
278
|
+
# A valid Position must have both x and y coordinates.
|
279
|
+
# The position coordinates are in the same scale as the original image.
|
280
|
+
class Position
|
437
281
|
include Google::Apis::Core::Hashable
|
438
282
|
|
439
|
-
#
|
440
|
-
# Corresponds to the JSON property `
|
441
|
-
# @return [Float]
|
442
|
-
attr_accessor :green
|
443
|
-
|
444
|
-
# The amount of blue in the color as a value in the interval [0, 1].
|
445
|
-
# Corresponds to the JSON property `blue`
|
283
|
+
# Y coordinate.
|
284
|
+
# Corresponds to the JSON property `y`
|
446
285
|
# @return [Float]
|
447
|
-
attr_accessor :
|
286
|
+
attr_accessor :y
|
448
287
|
|
449
|
-
#
|
450
|
-
#
|
451
|
-
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
452
|
-
# This means that a value of 1.0 corresponds to a solid color, whereas
|
453
|
-
# a value of 0.0 corresponds to a completely transparent color. This
|
454
|
-
# uses a wrapper message rather than a simple float scalar so that it is
|
455
|
-
# possible to distinguish between a default value and the value being unset.
|
456
|
-
# If omitted, this color object is to be rendered as a solid color
|
457
|
-
# (as if the alpha value had been explicitly given with a value of 1.0).
|
458
|
-
# Corresponds to the JSON property `alpha`
|
288
|
+
# X coordinate.
|
289
|
+
# Corresponds to the JSON property `x`
|
459
290
|
# @return [Float]
|
460
|
-
attr_accessor :
|
291
|
+
attr_accessor :x
|
461
292
|
|
462
|
-
#
|
463
|
-
# Corresponds to the JSON property `
|
293
|
+
# Z coordinate (or depth).
|
294
|
+
# Corresponds to the JSON property `z`
|
464
295
|
# @return [Float]
|
465
|
-
attr_accessor :
|
466
|
-
|
467
|
-
def initialize(**args)
|
468
|
-
update!(**args)
|
469
|
-
end
|
470
|
-
|
471
|
-
# Update properties of this object
|
472
|
-
def update!(**args)
|
473
|
-
@green = args[:green] if args.key?(:green)
|
474
|
-
@blue = args[:blue] if args.key?(:blue)
|
475
|
-
@alpha = args[:alpha] if args.key?(:alpha)
|
476
|
-
@red = args[:red] if args.key?(:red)
|
477
|
-
end
|
478
|
-
end
|
479
|
-
|
480
|
-
# Stores image properties, such as dominant colors.
|
481
|
-
class ImageProperties
|
482
|
-
include Google::Apis::Core::Hashable
|
483
|
-
|
484
|
-
# Set of dominant colors and their corresponding scores.
|
485
|
-
# Corresponds to the JSON property `dominantColors`
|
486
|
-
# @return [Google::Apis::VisionV1::DominantColorsAnnotation]
|
487
|
-
attr_accessor :dominant_colors
|
296
|
+
attr_accessor :z
|
488
297
|
|
489
298
|
def initialize(**args)
|
490
299
|
update!(**args)
|
@@ -492,65 +301,157 @@ module Google
|
|
492
301
|
|
493
302
|
# Update properties of this object
|
494
303
|
def update!(**args)
|
495
|
-
@
|
304
|
+
@y = args[:y] if args.key?(:y)
|
305
|
+
@x = args[:x] if args.key?(:x)
|
306
|
+
@z = args[:z] if args.key?(:z)
|
496
307
|
end
|
497
308
|
end
|
498
309
|
|
499
|
-
#
|
500
|
-
#
|
501
|
-
|
502
|
-
# vertical to operate on and the number of top-scoring results to return.
|
503
|
-
class Feature
|
310
|
+
# Color information consists of RGB channels, score, and the fraction of
|
311
|
+
# the image that the color occupies in the image.
|
312
|
+
class ColorInfo
|
504
313
|
include Google::Apis::Core::Hashable
|
505
314
|
|
506
|
-
# The
|
507
|
-
#
|
508
|
-
#
|
509
|
-
|
510
|
-
|
511
|
-
# Maximum number of results of this type.
|
512
|
-
# Corresponds to the JSON property `maxResults`
|
513
|
-
# @return [Fixnum]
|
514
|
-
attr_accessor :max_results
|
315
|
+
# The fraction of pixels the color occupies in the image.
|
316
|
+
# Value in range [0, 1].
|
317
|
+
# Corresponds to the JSON property `pixelFraction`
|
318
|
+
# @return [Float]
|
319
|
+
attr_accessor :pixel_fraction
|
515
320
|
|
516
|
-
|
321
|
+
# Represents a color in the RGBA color space. This representation is designed
|
322
|
+
# for simplicity of conversion to/from color representations in various
|
323
|
+
# languages over compactness; for example, the fields of this representation
|
324
|
+
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
325
|
+
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
326
|
+
# method in iOS; and, with just a little work, it can be easily formatted into
|
327
|
+
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
328
|
+
# Example (Java):
|
329
|
+
# import com.google.type.Color;
|
330
|
+
# // ...
|
331
|
+
# public static java.awt.Color fromProto(Color protocolor) `
|
332
|
+
# float alpha = protocolor.hasAlpha()
|
333
|
+
# ? protocolor.getAlpha().getValue()
|
334
|
+
# : 1.0;
|
335
|
+
# return new java.awt.Color(
|
336
|
+
# protocolor.getRed(),
|
337
|
+
# protocolor.getGreen(),
|
338
|
+
# protocolor.getBlue(),
|
339
|
+
# alpha);
|
340
|
+
# `
|
341
|
+
# public static Color toProto(java.awt.Color color) `
|
342
|
+
# float red = (float) color.getRed();
|
343
|
+
# float green = (float) color.getGreen();
|
344
|
+
# float blue = (float) color.getBlue();
|
345
|
+
# float denominator = 255.0;
|
346
|
+
# Color.Builder resultBuilder =
|
347
|
+
# Color
|
348
|
+
# .newBuilder()
|
349
|
+
# .setRed(red / denominator)
|
350
|
+
# .setGreen(green / denominator)
|
351
|
+
# .setBlue(blue / denominator);
|
352
|
+
# int alpha = color.getAlpha();
|
353
|
+
# if (alpha != 255) `
|
354
|
+
# result.setAlpha(
|
355
|
+
# FloatValue
|
356
|
+
# .newBuilder()
|
357
|
+
# .setValue(((float) alpha) / denominator)
|
358
|
+
# .build());
|
359
|
+
# `
|
360
|
+
# return resultBuilder.build();
|
361
|
+
# `
|
362
|
+
# // ...
|
363
|
+
# Example (iOS / Obj-C):
|
364
|
+
# // ...
|
365
|
+
# static UIColor* fromProto(Color* protocolor) `
|
366
|
+
# float red = [protocolor red];
|
367
|
+
# float green = [protocolor green];
|
368
|
+
# float blue = [protocolor blue];
|
369
|
+
# FloatValue* alpha_wrapper = [protocolor alpha];
|
370
|
+
# float alpha = 1.0;
|
371
|
+
# if (alpha_wrapper != nil) `
|
372
|
+
# alpha = [alpha_wrapper value];
|
373
|
+
# `
|
374
|
+
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
375
|
+
# `
|
376
|
+
# static Color* toProto(UIColor* color) `
|
377
|
+
# CGFloat red, green, blue, alpha;
|
378
|
+
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
379
|
+
# return nil;
|
380
|
+
# `
|
381
|
+
# Color* result = [Color alloc] init];
|
382
|
+
# [result setRed:red];
|
383
|
+
# [result setGreen:green];
|
384
|
+
# [result setBlue:blue];
|
385
|
+
# if (alpha <= 0.9999) `
|
386
|
+
# [result setAlpha:floatWrapperWithValue(alpha)];
|
387
|
+
# `
|
388
|
+
# [result autorelease];
|
389
|
+
# return result;
|
390
|
+
# `
|
391
|
+
# // ...
|
392
|
+
# Example (JavaScript):
|
393
|
+
# // ...
|
394
|
+
# var protoToCssColor = function(rgb_color) `
|
395
|
+
# var redFrac = rgb_color.red || 0.0;
|
396
|
+
# var greenFrac = rgb_color.green || 0.0;
|
397
|
+
# var blueFrac = rgb_color.blue || 0.0;
|
398
|
+
# var red = Math.floor(redFrac * 255);
|
399
|
+
# var green = Math.floor(greenFrac * 255);
|
400
|
+
# var blue = Math.floor(blueFrac * 255);
|
401
|
+
# if (!('alpha' in rgb_color)) `
|
402
|
+
# return rgbToCssColor_(red, green, blue);
|
403
|
+
# `
|
404
|
+
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
405
|
+
# var rgbParams = [red, green, blue].join(',');
|
406
|
+
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
407
|
+
# `;
|
408
|
+
# var rgbToCssColor_ = function(red, green, blue) `
|
409
|
+
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
410
|
+
# var hexString = rgbNumber.toString(16);
|
411
|
+
# var missingZeros = 6 - hexString.length;
|
412
|
+
# var resultBuilder = ['#'];
|
413
|
+
# for (var i = 0; i < missingZeros; i++) `
|
414
|
+
# resultBuilder.push('0');
|
415
|
+
# `
|
416
|
+
# resultBuilder.push(hexString);
|
417
|
+
# return resultBuilder.join('');
|
418
|
+
# `;
|
419
|
+
# // ...
|
420
|
+
# Corresponds to the JSON property `color`
|
421
|
+
# @return [Google::Apis::VisionV1::Color]
|
422
|
+
attr_accessor :color
|
423
|
+
|
424
|
+
# Image-specific score for this color. Value in range [0, 1].
|
425
|
+
# Corresponds to the JSON property `score`
|
426
|
+
# @return [Float]
|
427
|
+
attr_accessor :score
|
428
|
+
|
429
|
+
def initialize(**args)
|
517
430
|
update!(**args)
|
518
431
|
end
|
519
432
|
|
520
433
|
# Update properties of this object
|
521
434
|
def update!(**args)
|
522
|
-
@
|
523
|
-
@
|
435
|
+
@pixel_fraction = args[:pixel_fraction] if args.key?(:pixel_fraction)
|
436
|
+
@color = args[:color] if args.key?(:color)
|
437
|
+
@score = args[:score] if args.key?(:score)
|
524
438
|
end
|
525
439
|
end
|
526
440
|
|
527
|
-
#
|
528
|
-
|
529
|
-
# violence).
|
530
|
-
class SafeSearchAnnotation
|
441
|
+
# Metadata for web pages.
|
442
|
+
class WebPage
|
531
443
|
include Google::Apis::Core::Hashable
|
532
444
|
|
533
|
-
#
|
534
|
-
# Corresponds to the JSON property `
|
535
|
-
# @return [String]
|
536
|
-
attr_accessor :adult
|
537
|
-
|
538
|
-
# Spoof likelihood. The likelihood that an modification
|
539
|
-
# was made to the image's canonical version to make it appear
|
540
|
-
# funny or offensive.
|
541
|
-
# Corresponds to the JSON property `spoof`
|
542
|
-
# @return [String]
|
543
|
-
attr_accessor :spoof
|
544
|
-
|
545
|
-
# Likelihood that this is a medical image.
|
546
|
-
# Corresponds to the JSON property `medical`
|
445
|
+
# The result web page URL.
|
446
|
+
# Corresponds to the JSON property `url`
|
547
447
|
# @return [String]
|
548
|
-
attr_accessor :
|
448
|
+
attr_accessor :url
|
549
449
|
|
550
|
-
#
|
551
|
-
#
|
552
|
-
#
|
553
|
-
|
450
|
+
# Overall relevancy score for the web page.
|
451
|
+
# Not normalized and not comparable across different image queries.
|
452
|
+
# Corresponds to the JSON property `score`
|
453
|
+
# @return [Float]
|
454
|
+
attr_accessor :score
|
554
455
|
|
555
456
|
def initialize(**args)
|
556
457
|
update!(**args)
|
@@ -558,51 +459,74 @@ module Google
|
|
558
459
|
|
559
460
|
# Update properties of this object
|
560
461
|
def update!(**args)
|
561
|
-
@
|
562
|
-
@
|
563
|
-
@medical = args[:medical] if args.key?(:medical)
|
564
|
-
@violence = args[:violence] if args.key?(:violence)
|
462
|
+
@url = args[:url] if args.key?(:url)
|
463
|
+
@score = args[:score] if args.key?(:score)
|
565
464
|
end
|
566
465
|
end
|
567
466
|
|
568
|
-
# Set of
|
569
|
-
class
|
467
|
+
# Set of detected entity features.
|
468
|
+
class EntityAnnotation
|
570
469
|
include Google::Apis::Core::Hashable
|
571
470
|
|
572
|
-
#
|
573
|
-
#
|
574
|
-
#
|
575
|
-
|
471
|
+
# The location information for the detected entity. Multiple
|
472
|
+
# `LocationInfo` elements can be present because one location may
|
473
|
+
# indicate the location of the scene in the image, and another location
|
474
|
+
# may indicate the location of the place where the image was taken.
|
475
|
+
# Location information is usually present for landmarks.
|
476
|
+
# Corresponds to the JSON property `locations`
|
477
|
+
# @return [Array<Google::Apis::VisionV1::LocationInfo>]
|
478
|
+
attr_accessor :locations
|
576
479
|
|
577
|
-
|
578
|
-
|
579
|
-
|
480
|
+
# Opaque entity ID. Some IDs may be available in
|
481
|
+
# [Google Knowledge Graph Search API](https://developers.google.com/knowledge-
|
482
|
+
# graph/).
|
483
|
+
# Corresponds to the JSON property `mid`
|
484
|
+
# @return [String]
|
485
|
+
attr_accessor :mid
|
580
486
|
|
581
|
-
#
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
487
|
+
# The accuracy of the entity detection in an image.
|
488
|
+
# For example, for an image in which the "Eiffel Tower" entity is detected,
|
489
|
+
# this field represents the confidence that there is a tower in the query
|
490
|
+
# image. Range [0, 1].
|
491
|
+
# Corresponds to the JSON property `confidence`
|
492
|
+
# @return [Float]
|
493
|
+
attr_accessor :confidence
|
586
494
|
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
# properties. Properties describe detected languages, breaks etc.. Please
|
592
|
-
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
593
|
-
# definition below for more detail.
|
594
|
-
class TextAnnotation
|
595
|
-
include Google::Apis::Core::Hashable
|
495
|
+
# A bounding polygon for the detected image annotation.
|
496
|
+
# Corresponds to the JSON property `boundingPoly`
|
497
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
498
|
+
attr_accessor :bounding_poly
|
596
499
|
|
597
|
-
#
|
598
|
-
#
|
599
|
-
#
|
600
|
-
|
500
|
+
# The language code for the locale in which the entity textual
|
501
|
+
# `description` is expressed.
|
502
|
+
# Corresponds to the JSON property `locale`
|
503
|
+
# @return [String]
|
504
|
+
attr_accessor :locale
|
601
505
|
|
602
|
-
#
|
603
|
-
# Corresponds to the JSON property `
|
506
|
+
# Entity textual description, expressed in its `locale` language.
|
507
|
+
# Corresponds to the JSON property `description`
|
604
508
|
# @return [String]
|
605
|
-
attr_accessor :
|
509
|
+
attr_accessor :description
|
510
|
+
|
511
|
+
# The relevancy of the ICA (Image Content Annotation) label to the
|
512
|
+
# image. For example, the relevancy of "tower" is likely higher to an image
|
513
|
+
# containing the detected "Eiffel Tower" than to an image containing a
|
514
|
+
# detected distant towering building, even though the confidence that
|
515
|
+
# there is a tower in each image may be the same. Range [0, 1].
|
516
|
+
# Corresponds to the JSON property `topicality`
|
517
|
+
# @return [Float]
|
518
|
+
attr_accessor :topicality
|
519
|
+
|
520
|
+
# Some entities may have optional user-supplied `Property` (name/value)
|
521
|
+
# fields, such a score or string that qualifies the entity.
|
522
|
+
# Corresponds to the JSON property `properties`
|
523
|
+
# @return [Array<Google::Apis::VisionV1::Property>]
|
524
|
+
attr_accessor :properties
|
525
|
+
|
526
|
+
# Overall score of the result. Range [0, 1].
|
527
|
+
# Corresponds to the JSON property `score`
|
528
|
+
# @return [Float]
|
529
|
+
attr_accessor :score
|
606
530
|
|
607
531
|
def initialize(**args)
|
608
532
|
update!(**args)
|
@@ -610,25 +534,37 @@ module Google
|
|
610
534
|
|
611
535
|
# Update properties of this object
|
612
536
|
def update!(**args)
|
613
|
-
@
|
614
|
-
@
|
537
|
+
@locations = args[:locations] if args.key?(:locations)
|
538
|
+
@mid = args[:mid] if args.key?(:mid)
|
539
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
540
|
+
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
541
|
+
@locale = args[:locale] if args.key?(:locale)
|
542
|
+
@description = args[:description] if args.key?(:description)
|
543
|
+
@topicality = args[:topicality] if args.key?(:topicality)
|
544
|
+
@properties = args[:properties] if args.key?(:properties)
|
545
|
+
@score = args[:score] if args.key?(:score)
|
615
546
|
end
|
616
547
|
end
|
617
548
|
|
618
|
-
#
|
619
|
-
|
620
|
-
class Vertex
|
549
|
+
# Single crop hint that is used to generate a new crop when serving an image.
|
550
|
+
class CropHint
|
621
551
|
include Google::Apis::Core::Hashable
|
622
552
|
|
623
|
-
#
|
624
|
-
# Corresponds to the JSON property `
|
625
|
-
# @return [
|
626
|
-
attr_accessor :
|
553
|
+
# Confidence of this being a salient region. Range [0, 1].
|
554
|
+
# Corresponds to the JSON property `confidence`
|
555
|
+
# @return [Float]
|
556
|
+
attr_accessor :confidence
|
627
557
|
|
628
|
-
#
|
629
|
-
#
|
630
|
-
#
|
631
|
-
|
558
|
+
# Fraction of importance of this salient region with respect to the original
|
559
|
+
# image.
|
560
|
+
# Corresponds to the JSON property `importanceFraction`
|
561
|
+
# @return [Float]
|
562
|
+
attr_accessor :importance_fraction
|
563
|
+
|
564
|
+
# A bounding polygon for the detected image annotation.
|
565
|
+
# Corresponds to the JSON property `boundingPoly`
|
566
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
567
|
+
attr_accessor :bounding_poly
|
632
568
|
|
633
569
|
def initialize(**args)
|
634
570
|
update!(**args)
|
@@ -636,26 +572,31 @@ module Google
|
|
636
572
|
|
637
573
|
# Update properties of this object
|
638
574
|
def update!(**args)
|
639
|
-
@
|
640
|
-
@
|
575
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
576
|
+
@importance_fraction = args[:importance_fraction] if args.key?(:importance_fraction)
|
577
|
+
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
641
578
|
end
|
642
579
|
end
|
643
580
|
|
644
|
-
#
|
645
|
-
|
581
|
+
# A face-specific landmark (for example, a face feature).
|
582
|
+
# Landmark positions may fall outside the bounds of the image
|
583
|
+
# if the face is near one or more edges of the image.
|
584
|
+
# Therefore it is NOT guaranteed that `0 <= x < width` or
|
585
|
+
# `0 <= y < height`.
|
586
|
+
class Landmark
|
646
587
|
include Google::Apis::Core::Hashable
|
647
588
|
|
648
|
-
#
|
649
|
-
# Corresponds to the JSON property `
|
650
|
-
# @return [Float]
|
651
|
-
attr_accessor :confidence
|
652
|
-
|
653
|
-
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
654
|
-
# information, see
|
655
|
-
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
656
|
-
# Corresponds to the JSON property `languageCode`
|
589
|
+
# Face landmark type.
|
590
|
+
# Corresponds to the JSON property `type`
|
657
591
|
# @return [String]
|
658
|
-
attr_accessor :
|
592
|
+
attr_accessor :type
|
593
|
+
|
594
|
+
# A 3D position in the image, used primarily for Face detection landmarks.
|
595
|
+
# A valid Position must have both x and y coordinates.
|
596
|
+
# The position coordinates are in the same scale as the original image.
|
597
|
+
# Corresponds to the JSON property `position`
|
598
|
+
# @return [Google::Apis::VisionV1::Position]
|
599
|
+
attr_accessor :position
|
659
600
|
|
660
601
|
def initialize(**args)
|
661
602
|
update!(**args)
|
@@ -663,56 +604,56 @@ module Google
|
|
663
604
|
|
664
605
|
# Update properties of this object
|
665
606
|
def update!(**args)
|
666
|
-
@
|
667
|
-
@
|
607
|
+
@type = args[:type] if args.key?(:type)
|
608
|
+
@position = args[:position] if args.key?(:position)
|
668
609
|
end
|
669
610
|
end
|
670
611
|
|
671
|
-
#
|
672
|
-
class
|
612
|
+
# Metadata for online images.
|
613
|
+
class WebImage
|
673
614
|
include Google::Apis::Core::Hashable
|
674
615
|
|
675
|
-
#
|
676
|
-
# Corresponds to the JSON property `entityId`
|
677
|
-
# @return [String]
|
678
|
-
attr_accessor :entity_id
|
679
|
-
|
680
|
-
# Canonical description of the entity, in English.
|
681
|
-
# Corresponds to the JSON property `description`
|
682
|
-
# @return [String]
|
683
|
-
attr_accessor :description
|
684
|
-
|
685
|
-
# Overall relevancy score for the entity.
|
616
|
+
# Overall relevancy score for the image.
|
686
617
|
# Not normalized and not comparable across different image queries.
|
687
618
|
# Corresponds to the JSON property `score`
|
688
619
|
# @return [Float]
|
689
620
|
attr_accessor :score
|
690
621
|
|
622
|
+
# The result image URL.
|
623
|
+
# Corresponds to the JSON property `url`
|
624
|
+
# @return [String]
|
625
|
+
attr_accessor :url
|
626
|
+
|
691
627
|
def initialize(**args)
|
692
628
|
update!(**args)
|
693
629
|
end
|
694
630
|
|
695
631
|
# Update properties of this object
|
696
632
|
def update!(**args)
|
697
|
-
@entity_id = args[:entity_id] if args.key?(:entity_id)
|
698
|
-
@description = args[:description] if args.key?(:description)
|
699
633
|
@score = args[:score] if args.key?(:score)
|
634
|
+
@url = args[:url] if args.key?(:url)
|
700
635
|
end
|
701
636
|
end
|
702
637
|
|
703
|
-
#
|
704
|
-
class
|
638
|
+
# A word representation.
|
639
|
+
class Word
|
705
640
|
include Google::Apis::Core::Hashable
|
706
641
|
|
707
|
-
#
|
708
|
-
# Corresponds to the JSON property `
|
709
|
-
# @return [Google::Apis::VisionV1::
|
710
|
-
attr_accessor :
|
642
|
+
# A bounding polygon for the detected image annotation.
|
643
|
+
# Corresponds to the JSON property `boundingBox`
|
644
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
645
|
+
attr_accessor :bounding_box
|
711
646
|
|
712
|
-
#
|
713
|
-
#
|
714
|
-
#
|
715
|
-
|
647
|
+
# List of symbols in the word.
|
648
|
+
# The order of the symbols follows the natural reading order.
|
649
|
+
# Corresponds to the JSON property `symbols`
|
650
|
+
# @return [Array<Google::Apis::VisionV1::Symbol>]
|
651
|
+
attr_accessor :symbols
|
652
|
+
|
653
|
+
# Additional information detected on the structural component.
|
654
|
+
# Corresponds to the JSON property `property`
|
655
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
656
|
+
attr_accessor :property
|
716
657
|
|
717
658
|
def initialize(**args)
|
718
659
|
update!(**args)
|
@@ -720,19 +661,28 @@ module Google
|
|
720
661
|
|
721
662
|
# Update properties of this object
|
722
663
|
def update!(**args)
|
723
|
-
@
|
724
|
-
@
|
664
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
665
|
+
@symbols = args[:symbols] if args.key?(:symbols)
|
666
|
+
@property = args[:property] if args.key?(:property)
|
725
667
|
end
|
726
668
|
end
|
727
669
|
|
728
|
-
#
|
729
|
-
class
|
670
|
+
# Client image to perform Google Cloud Vision API tasks over.
|
671
|
+
class Image
|
730
672
|
include Google::Apis::Core::Hashable
|
731
673
|
|
732
|
-
#
|
733
|
-
#
|
734
|
-
#
|
735
|
-
|
674
|
+
# Image content, represented as a stream of bytes.
|
675
|
+
# Note: as with all `bytes` fields, protobuffers use a pure binary
|
676
|
+
# representation, whereas JSON representations use base64.
|
677
|
+
# Corresponds to the JSON property `content`
|
678
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
679
|
+
# @return [String]
|
680
|
+
attr_accessor :content
|
681
|
+
|
682
|
+
# External image source (Google Cloud Storage image location).
|
683
|
+
# Corresponds to the JSON property `source`
|
684
|
+
# @return [Google::Apis::VisionV1::ImageSource]
|
685
|
+
attr_accessor :source
|
736
686
|
|
737
687
|
def initialize(**args)
|
738
688
|
update!(**args)
|
@@ -740,114 +690,29 @@ module Google
|
|
740
690
|
|
741
691
|
# Update properties of this object
|
742
692
|
def update!(**args)
|
743
|
-
@
|
693
|
+
@content = args[:content] if args.key?(:content)
|
694
|
+
@source = args[:source] if args.key?(:source)
|
744
695
|
end
|
745
696
|
end
|
746
697
|
|
747
|
-
#
|
748
|
-
class
|
698
|
+
# Structural unit of text representing a number of words in certain order.
|
699
|
+
class Paragraph
|
749
700
|
include Google::Apis::Core::Hashable
|
750
701
|
|
751
|
-
#
|
752
|
-
#
|
753
|
-
# [
|
754
|
-
|
755
|
-
# - Flexible enough to meet unexpected needs
|
756
|
-
# # Overview
|
757
|
-
# The `Status` message contains three pieces of data: error code, error message,
|
758
|
-
# and error details. The error code should be an enum value of
|
759
|
-
# google.rpc.Code, but it may accept additional error codes if needed. The
|
760
|
-
# error message should be a developer-facing English message that helps
|
761
|
-
# developers *understand* and *resolve* the error. If a localized user-facing
|
762
|
-
# error message is needed, put the localized message in the error details or
|
763
|
-
# localize it in the client. The optional error details may contain arbitrary
|
764
|
-
# information about the error. There is a predefined set of error detail types
|
765
|
-
# in the package `google.rpc` which can be used for common error conditions.
|
766
|
-
# # Language mapping
|
767
|
-
# The `Status` message is the logical representation of the error model, but it
|
768
|
-
# is not necessarily the actual wire format. When the `Status` message is
|
769
|
-
# exposed in different client libraries and different wire protocols, it can be
|
770
|
-
# mapped differently. For example, it will likely be mapped to some exceptions
|
771
|
-
# in Java, but more likely mapped to some error codes in C.
|
772
|
-
# # Other uses
|
773
|
-
# The error model and the `Status` message can be used in a variety of
|
774
|
-
# environments, either with or without APIs, to provide a
|
775
|
-
# consistent developer experience across different environments.
|
776
|
-
# Example uses of this error model include:
|
777
|
-
# - Partial errors. If a service needs to return partial errors to the client,
|
778
|
-
# it may embed the `Status` in the normal response to indicate the partial
|
779
|
-
# errors.
|
780
|
-
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
781
|
-
# have a `Status` message for error reporting purpose.
|
782
|
-
# - Batch operations. If a client uses batch request and batch response, the
|
783
|
-
# `Status` message should be used directly inside batch response, one for
|
784
|
-
# each error sub-response.
|
785
|
-
# - Asynchronous operations. If an API call embeds asynchronous operation
|
786
|
-
# results in its response, the status of those operations should be
|
787
|
-
# represented directly using the `Status` message.
|
788
|
-
# - Logging. If some API errors are stored in logs, the message `Status` could
|
789
|
-
# be used directly after any stripping needed for security/privacy reasons.
|
790
|
-
# Corresponds to the JSON property `error`
|
791
|
-
# @return [Google::Apis::VisionV1::Status]
|
792
|
-
attr_accessor :error
|
793
|
-
|
794
|
-
# TextAnnotation contains a structured representation of OCR extracted text.
|
795
|
-
# The hierarchy of an OCR extracted text structure is like this:
|
796
|
-
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
797
|
-
# Each structural component, starting from Page, may further have their own
|
798
|
-
# properties. Properties describe detected languages, breaks etc.. Please
|
799
|
-
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
800
|
-
# definition below for more detail.
|
801
|
-
# Corresponds to the JSON property `fullTextAnnotation`
|
802
|
-
# @return [Google::Apis::VisionV1::TextAnnotation]
|
803
|
-
attr_accessor :full_text_annotation
|
804
|
-
|
805
|
-
# If present, landmark detection has completed successfully.
|
806
|
-
# Corresponds to the JSON property `landmarkAnnotations`
|
807
|
-
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
808
|
-
attr_accessor :landmark_annotations
|
809
|
-
|
810
|
-
# If present, text (OCR) detection has completed successfully.
|
811
|
-
# Corresponds to the JSON property `textAnnotations`
|
812
|
-
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
813
|
-
attr_accessor :text_annotations
|
814
|
-
|
815
|
-
# If present, face detection has completed successfully.
|
816
|
-
# Corresponds to the JSON property `faceAnnotations`
|
817
|
-
# @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
|
818
|
-
attr_accessor :face_annotations
|
819
|
-
|
820
|
-
# Stores image properties, such as dominant colors.
|
821
|
-
# Corresponds to the JSON property `imagePropertiesAnnotation`
|
822
|
-
# @return [Google::Apis::VisionV1::ImageProperties]
|
823
|
-
attr_accessor :image_properties_annotation
|
824
|
-
|
825
|
-
# If present, logo detection has completed successfully.
|
826
|
-
# Corresponds to the JSON property `logoAnnotations`
|
827
|
-
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
828
|
-
attr_accessor :logo_annotations
|
829
|
-
|
830
|
-
# Relevant information for the image from the Internet.
|
831
|
-
# Corresponds to the JSON property `webDetection`
|
832
|
-
# @return [Google::Apis::VisionV1::WebDetection]
|
833
|
-
attr_accessor :web_detection
|
834
|
-
|
835
|
-
# Set of crop hints that are used to generate new crops when serving images.
|
836
|
-
# Corresponds to the JSON property `cropHintsAnnotation`
|
837
|
-
# @return [Google::Apis::VisionV1::CropHintsAnnotation]
|
838
|
-
attr_accessor :crop_hints_annotation
|
702
|
+
# A bounding polygon for the detected image annotation.
|
703
|
+
# Corresponds to the JSON property `boundingBox`
|
704
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
705
|
+
attr_accessor :bounding_box
|
839
706
|
|
840
|
-
#
|
841
|
-
#
|
842
|
-
#
|
843
|
-
|
844
|
-
# @return [Google::Apis::VisionV1::SafeSearchAnnotation]
|
845
|
-
attr_accessor :safe_search_annotation
|
707
|
+
# List of words in this paragraph.
|
708
|
+
# Corresponds to the JSON property `words`
|
709
|
+
# @return [Array<Google::Apis::VisionV1::Word>]
|
710
|
+
attr_accessor :words
|
846
711
|
|
847
|
-
#
|
848
|
-
# Corresponds to the JSON property `
|
849
|
-
# @return [
|
850
|
-
attr_accessor :
|
712
|
+
# Additional information detected on the structural component.
|
713
|
+
# Corresponds to the JSON property `property`
|
714
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
715
|
+
attr_accessor :property
|
851
716
|
|
852
717
|
def initialize(**args)
|
853
718
|
update!(**args)
|
@@ -855,67 +720,95 @@ module Google
|
|
855
720
|
|
856
721
|
# Update properties of this object
|
857
722
|
def update!(**args)
|
858
|
-
@
|
859
|
-
@
|
860
|
-
@
|
861
|
-
@text_annotations = args[:text_annotations] if args.key?(:text_annotations)
|
862
|
-
@face_annotations = args[:face_annotations] if args.key?(:face_annotations)
|
863
|
-
@image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
|
864
|
-
@logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
|
865
|
-
@web_detection = args[:web_detection] if args.key?(:web_detection)
|
866
|
-
@crop_hints_annotation = args[:crop_hints_annotation] if args.key?(:crop_hints_annotation)
|
867
|
-
@safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
|
868
|
-
@label_annotations = args[:label_annotations] if args.key?(:label_annotations)
|
723
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
724
|
+
@words = args[:words] if args.key?(:words)
|
725
|
+
@property = args[:property] if args.key?(:property)
|
869
726
|
end
|
870
727
|
end
|
871
728
|
|
872
|
-
#
|
873
|
-
class
|
729
|
+
# A face annotation object contains the results of face detection.
|
730
|
+
class FaceAnnotation
|
874
731
|
include Google::Apis::Core::Hashable
|
875
732
|
|
876
|
-
#
|
877
|
-
#
|
878
|
-
#
|
879
|
-
|
880
|
-
# limited to a maximum of 16; any aspect ratios provided after the 16th are
|
881
|
-
# ignored.
|
882
|
-
# Corresponds to the JSON property `aspectRatios`
|
883
|
-
# @return [Array<Float>]
|
884
|
-
attr_accessor :aspect_ratios
|
733
|
+
# A bounding polygon for the detected image annotation.
|
734
|
+
# Corresponds to the JSON property `fdBoundingPoly`
|
735
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
736
|
+
attr_accessor :fd_bounding_poly
|
885
737
|
|
886
|
-
|
887
|
-
|
888
|
-
|
738
|
+
# Anger likelihood.
|
739
|
+
# Corresponds to the JSON property `angerLikelihood`
|
740
|
+
# @return [String]
|
741
|
+
attr_accessor :anger_likelihood
|
889
742
|
|
890
|
-
#
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
end
|
743
|
+
# Detected face landmarks.
|
744
|
+
# Corresponds to the JSON property `landmarks`
|
745
|
+
# @return [Array<Google::Apis::VisionV1::Landmark>]
|
746
|
+
attr_accessor :landmarks
|
895
747
|
|
896
|
-
|
897
|
-
|
898
|
-
|
748
|
+
# Surprise likelihood.
|
749
|
+
# Corresponds to the JSON property `surpriseLikelihood`
|
750
|
+
# @return [String]
|
751
|
+
attr_accessor :surprise_likelihood
|
899
752
|
|
900
|
-
#
|
901
|
-
# Corresponds to the JSON property `
|
902
|
-
# @return [
|
903
|
-
attr_accessor :
|
753
|
+
# Face landmarking confidence. Range [0, 1].
|
754
|
+
# Corresponds to the JSON property `landmarkingConfidence`
|
755
|
+
# @return [Float]
|
756
|
+
attr_accessor :landmarking_confidence
|
904
757
|
|
905
|
-
#
|
906
|
-
# Corresponds to the JSON property `
|
758
|
+
# Joy likelihood.
|
759
|
+
# Corresponds to the JSON property `joyLikelihood`
|
907
760
|
# @return [String]
|
908
|
-
attr_accessor :
|
761
|
+
attr_accessor :joy_likelihood
|
762
|
+
|
763
|
+
# Detection confidence. Range [0, 1].
|
764
|
+
# Corresponds to the JSON property `detectionConfidence`
|
765
|
+
# @return [Float]
|
766
|
+
attr_accessor :detection_confidence
|
767
|
+
|
768
|
+
# Yaw angle, which indicates the leftward/rightward angle that the face is
|
769
|
+
# pointing relative to the vertical plane perpendicular to the image. Range
|
770
|
+
# [-180,180].
|
771
|
+
# Corresponds to the JSON property `panAngle`
|
772
|
+
# @return [Float]
|
773
|
+
attr_accessor :pan_angle
|
774
|
+
|
775
|
+
# Under-exposed likelihood.
|
776
|
+
# Corresponds to the JSON property `underExposedLikelihood`
|
777
|
+
# @return [String]
|
778
|
+
attr_accessor :under_exposed_likelihood
|
779
|
+
|
780
|
+
# Blurred likelihood.
|
781
|
+
# Corresponds to the JSON property `blurredLikelihood`
|
782
|
+
# @return [String]
|
783
|
+
attr_accessor :blurred_likelihood
|
784
|
+
|
785
|
+
# Headwear likelihood.
|
786
|
+
# Corresponds to the JSON property `headwearLikelihood`
|
787
|
+
# @return [String]
|
788
|
+
attr_accessor :headwear_likelihood
|
909
789
|
|
910
790
|
# A bounding polygon for the detected image annotation.
|
911
|
-
# Corresponds to the JSON property `
|
791
|
+
# Corresponds to the JSON property `boundingPoly`
|
912
792
|
# @return [Google::Apis::VisionV1::BoundingPoly]
|
913
|
-
attr_accessor :
|
793
|
+
attr_accessor :bounding_poly
|
914
794
|
|
915
|
-
#
|
916
|
-
#
|
917
|
-
#
|
918
|
-
|
795
|
+
# Roll angle, which indicates the amount of clockwise/anti-clockwise rotation
|
796
|
+
# of the face relative to the image vertical about the axis perpendicular to
|
797
|
+
# the face. Range [-180,180].
|
798
|
+
# Corresponds to the JSON property `rollAngle`
|
799
|
+
# @return [Float]
|
800
|
+
attr_accessor :roll_angle
|
801
|
+
|
802
|
+
# Sorrow likelihood.
|
803
|
+
# Corresponds to the JSON property `sorrowLikelihood`
|
804
|
+
# @return [String]
|
805
|
+
attr_accessor :sorrow_likelihood
|
806
|
+
|
807
|
+
# Pitch angle, which indicates the upwards/downwards angle that the face is
|
808
|
+
# pointing relative to the image's horizontal plane. Range [-180,180].
|
809
|
+
# Corresponds to the JSON property `tiltAngle`
|
810
|
+
# @return [Float]
|
811
|
+
attr_accessor :tilt_angle
|
919
812
|
|
920
813
|
def initialize(**args)
|
921
814
|
update!(**args)
|
@@ -923,45 +816,32 @@ module Google
|
|
923
816
|
|
924
817
|
# Update properties of this object
|
925
818
|
def update!(**args)
|
926
|
-
@
|
927
|
-
@
|
928
|
-
@
|
929
|
-
@
|
819
|
+
@fd_bounding_poly = args[:fd_bounding_poly] if args.key?(:fd_bounding_poly)
|
820
|
+
@anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
|
821
|
+
@landmarks = args[:landmarks] if args.key?(:landmarks)
|
822
|
+
@surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
|
823
|
+
@landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
|
824
|
+
@joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
|
825
|
+
@detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
|
826
|
+
@pan_angle = args[:pan_angle] if args.key?(:pan_angle)
|
827
|
+
@under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
|
828
|
+
@blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
|
829
|
+
@headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
|
830
|
+
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
831
|
+
@roll_angle = args[:roll_angle] if args.key?(:roll_angle)
|
832
|
+
@sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
|
833
|
+
@tilt_angle = args[:tilt_angle] if args.key?(:tilt_angle)
|
930
834
|
end
|
931
835
|
end
|
932
836
|
|
933
|
-
#
|
934
|
-
class
|
837
|
+
# Multiple image annotation requests are batched into a single service call.
|
838
|
+
class BatchAnnotateImagesRequest
|
935
839
|
include Google::Apis::Core::Hashable
|
936
840
|
|
937
|
-
#
|
938
|
-
#
|
939
|
-
#
|
940
|
-
|
941
|
-
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
942
|
-
attr_accessor :full_matching_images
|
943
|
-
|
944
|
-
# Deduced entities from similar images on the Internet.
|
945
|
-
# Corresponds to the JSON property `webEntities`
|
946
|
-
# @return [Array<Google::Apis::VisionV1::WebEntity>]
|
947
|
-
attr_accessor :web_entities
|
948
|
-
|
949
|
-
# Web pages containing the matching images from the Internet.
|
950
|
-
# Corresponds to the JSON property `pagesWithMatchingImages`
|
951
|
-
# @return [Array<Google::Apis::VisionV1::WebPage>]
|
952
|
-
attr_accessor :pages_with_matching_images
|
953
|
-
|
954
|
-
# Partial matching images from the Internet.
|
955
|
-
# Those images are similar enough to share some key-point features. For
|
956
|
-
# example an original image will likely have partial matching for its crops.
|
957
|
-
# Corresponds to the JSON property `partialMatchingImages`
|
958
|
-
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
959
|
-
attr_accessor :partial_matching_images
|
960
|
-
|
961
|
-
# The visually similar image results.
|
962
|
-
# Corresponds to the JSON property `visuallySimilarImages`
|
963
|
-
# @return [Array<Google::Apis::VisionV1::WebImage>]
|
964
|
-
attr_accessor :visually_similar_images
|
841
|
+
# Individual image annotation requests for this batch.
|
842
|
+
# Corresponds to the JSON property `requests`
|
843
|
+
# @return [Array<Google::Apis::VisionV1::AnnotateImageRequest>]
|
844
|
+
attr_accessor :requests
|
965
845
|
|
966
846
|
def initialize(**args)
|
967
847
|
update!(**args)
|
@@ -969,22 +849,24 @@ module Google
|
|
969
849
|
|
970
850
|
# Update properties of this object
|
971
851
|
def update!(**args)
|
972
|
-
@
|
973
|
-
@web_entities = args[:web_entities] if args.key?(:web_entities)
|
974
|
-
@pages_with_matching_images = args[:pages_with_matching_images] if args.key?(:pages_with_matching_images)
|
975
|
-
@partial_matching_images = args[:partial_matching_images] if args.key?(:partial_matching_images)
|
976
|
-
@visually_similar_images = args[:visually_similar_images] if args.key?(:visually_similar_images)
|
852
|
+
@requests = args[:requests] if args.key?(:requests)
|
977
853
|
end
|
978
854
|
end
|
979
855
|
|
980
|
-
#
|
981
|
-
class
|
856
|
+
# Detected start or end of a structural component.
|
857
|
+
class DetectedBreak
|
982
858
|
include Google::Apis::Core::Hashable
|
983
859
|
|
984
|
-
#
|
985
|
-
# Corresponds to the JSON property `
|
986
|
-
# @return [
|
987
|
-
attr_accessor :
|
860
|
+
# Detected break type.
|
861
|
+
# Corresponds to the JSON property `type`
|
862
|
+
# @return [String]
|
863
|
+
attr_accessor :type
|
864
|
+
|
865
|
+
# True if break prepends the element.
|
866
|
+
# Corresponds to the JSON property `isPrefix`
|
867
|
+
# @return [Boolean]
|
868
|
+
attr_accessor :is_prefix
|
869
|
+
alias_method :is_prefix?, :is_prefix
|
988
870
|
|
989
871
|
def initialize(**args)
|
990
872
|
update!(**args)
|
@@ -992,37 +874,36 @@ module Google
|
|
992
874
|
|
993
875
|
# Update properties of this object
|
994
876
|
def update!(**args)
|
995
|
-
@
|
877
|
+
@type = args[:type] if args.key?(:type)
|
878
|
+
@is_prefix = args[:is_prefix] if args.key?(:is_prefix)
|
996
879
|
end
|
997
880
|
end
|
998
881
|
|
999
|
-
#
|
1000
|
-
class
|
882
|
+
# Image context and/or feature-specific parameters.
|
883
|
+
class ImageContext
|
1001
884
|
include Google::Apis::Core::Hashable
|
1002
885
|
|
1003
|
-
#
|
1004
|
-
#
|
1005
|
-
#
|
1006
|
-
|
1007
|
-
# URIs](https://cloud.google.com/storage/docs/reference-uris)).
|
1008
|
-
# NOTE: Cloud Storage object versioning is not supported.
|
1009
|
-
# 2) Publicly accessible image HTTP/HTTPS URL.
|
1010
|
-
# This is preferred over the legacy `gcs_image_uri` above. When both
|
1011
|
-
# `gcs_image_uri` and `image_uri` are specified, `image_uri` takes
|
1012
|
-
# precedence.
|
1013
|
-
# Corresponds to the JSON property `imageUri`
|
1014
|
-
# @return [String]
|
1015
|
-
attr_accessor :image_uri
|
886
|
+
# Rectangle determined by min and max `LatLng` pairs.
|
887
|
+
# Corresponds to the JSON property `latLongRect`
|
888
|
+
# @return [Google::Apis::VisionV1::LatLongRect]
|
889
|
+
attr_accessor :lat_long_rect
|
1016
890
|
|
1017
|
-
#
|
1018
|
-
#
|
1019
|
-
#
|
1020
|
-
|
1021
|
-
|
1022
|
-
#
|
1023
|
-
#
|
1024
|
-
#
|
1025
|
-
|
891
|
+
# Parameters for crop hints annotation request.
|
892
|
+
# Corresponds to the JSON property `cropHintsParams`
|
893
|
+
# @return [Google::Apis::VisionV1::CropHintsParams]
|
894
|
+
attr_accessor :crop_hints_params
|
895
|
+
|
896
|
+
# List of languages to use for TEXT_DETECTION. In most cases, an empty value
|
897
|
+
# yields the best results since it enables automatic language detection. For
|
898
|
+
# languages based on the Latin alphabet, setting `language_hints` is not
|
899
|
+
# needed. In rare cases, when the language of the text in the image is known,
|
900
|
+
# setting a hint will help get better results (although it will be a
|
901
|
+
# significant hindrance if the hint is wrong). Text detection returns an
|
902
|
+
# error if one or more of the specified languages is not one of the
|
903
|
+
# [supported languages](/vision/docs/languages).
|
904
|
+
# Corresponds to the JSON property `languageHints`
|
905
|
+
# @return [Array<String>]
|
906
|
+
attr_accessor :language_hints
|
1026
907
|
|
1027
908
|
def initialize(**args)
|
1028
909
|
update!(**args)
|
@@ -1030,55 +911,35 @@ module Google
|
|
1030
911
|
|
1031
912
|
# Update properties of this object
|
1032
913
|
def update!(**args)
|
1033
|
-
@
|
1034
|
-
@
|
914
|
+
@lat_long_rect = args[:lat_long_rect] if args.key?(:lat_long_rect)
|
915
|
+
@crop_hints_params = args[:crop_hints_params] if args.key?(:crop_hints_params)
|
916
|
+
@language_hints = args[:language_hints] if args.key?(:language_hints)
|
1035
917
|
end
|
1036
918
|
end
|
1037
919
|
|
1038
|
-
# Detected
|
1039
|
-
class
|
920
|
+
# Detected page from OCR.
|
921
|
+
class Page
|
1040
922
|
include Google::Apis::Core::Hashable
|
1041
923
|
|
1042
|
-
#
|
1043
|
-
#
|
1044
|
-
#
|
1045
|
-
|
1046
|
-
|
1047
|
-
#
|
1048
|
-
#
|
1049
|
-
#
|
1050
|
-
|
1051
|
-
|
1052
|
-
#
|
1053
|
-
#
|
1054
|
-
#
|
1055
|
-
|
1056
|
-
|
1057
|
-
#
|
1058
|
-
#
|
1059
|
-
# return
|
1060
|
-
|
1061
|
-
# return r - 360, NormalizeLongitude(longitude)
|
1062
|
-
# else:
|
1063
|
-
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1064
|
-
# assert 180.0 == NormalizeLongitude(180.0)
|
1065
|
-
# assert -180.0 == NormalizeLongitude(-180.0)
|
1066
|
-
# assert -179.0 == NormalizeLongitude(181.0)
|
1067
|
-
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1068
|
-
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1069
|
-
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1070
|
-
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1071
|
-
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1072
|
-
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1073
|
-
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1074
|
-
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1075
|
-
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1076
|
-
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1077
|
-
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1078
|
-
# as if it were annotated as ST_LOCATION.
|
1079
|
-
# Corresponds to the JSON property `latLng`
|
1080
|
-
# @return [Google::Apis::VisionV1::LatLng]
|
1081
|
-
attr_accessor :lat_lng
|
924
|
+
# Page height in pixels.
|
925
|
+
# Corresponds to the JSON property `height`
|
926
|
+
# @return [Fixnum]
|
927
|
+
attr_accessor :height
|
928
|
+
|
929
|
+
# Page width in pixels.
|
930
|
+
# Corresponds to the JSON property `width`
|
931
|
+
# @return [Fixnum]
|
932
|
+
attr_accessor :width
|
933
|
+
|
934
|
+
# List of blocks of text, images etc on this page.
|
935
|
+
# Corresponds to the JSON property `blocks`
|
936
|
+
# @return [Array<Google::Apis::VisionV1::Block>]
|
937
|
+
attr_accessor :blocks
|
938
|
+
|
939
|
+
# Additional information detected on the structural component.
|
940
|
+
# Corresponds to the JSON property `property`
|
941
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
942
|
+
attr_accessor :property
|
1082
943
|
|
1083
944
|
def initialize(**args)
|
1084
945
|
update!(**args)
|
@@ -1086,28 +947,32 @@ module Google
|
|
1086
947
|
|
1087
948
|
# Update properties of this object
|
1088
949
|
def update!(**args)
|
1089
|
-
@
|
950
|
+
@height = args[:height] if args.key?(:height)
|
951
|
+
@width = args[:width] if args.key?(:width)
|
952
|
+
@blocks = args[:blocks] if args.key?(:blocks)
|
953
|
+
@property = args[:property] if args.key?(:property)
|
1090
954
|
end
|
1091
955
|
end
|
1092
956
|
|
1093
|
-
#
|
1094
|
-
|
957
|
+
# Request for performing Google Cloud Vision API tasks over a user-provided
|
958
|
+
# image, with user-requested features.
|
959
|
+
class AnnotateImageRequest
|
1095
960
|
include Google::Apis::Core::Hashable
|
1096
961
|
|
1097
|
-
#
|
1098
|
-
# Corresponds to the JSON property `
|
1099
|
-
# @return [
|
1100
|
-
attr_accessor :
|
962
|
+
# Image context and/or feature-specific parameters.
|
963
|
+
# Corresponds to the JSON property `imageContext`
|
964
|
+
# @return [Google::Apis::VisionV1::ImageContext]
|
965
|
+
attr_accessor :image_context
|
1101
966
|
|
1102
|
-
#
|
1103
|
-
# Corresponds to the JSON property `
|
1104
|
-
# @return [
|
1105
|
-
attr_accessor :
|
967
|
+
# Client image to perform Google Cloud Vision API tasks over.
|
968
|
+
# Corresponds to the JSON property `image`
|
969
|
+
# @return [Google::Apis::VisionV1::Image]
|
970
|
+
attr_accessor :image
|
1106
971
|
|
1107
|
-
#
|
1108
|
-
# Corresponds to the JSON property `
|
1109
|
-
# @return [
|
1110
|
-
attr_accessor :
|
972
|
+
# Requested features.
|
973
|
+
# Corresponds to the JSON property `features`
|
974
|
+
# @return [Array<Google::Apis::VisionV1::Feature>]
|
975
|
+
attr_accessor :features
|
1111
976
|
|
1112
977
|
def initialize(**args)
|
1113
978
|
update!(**args)
|
@@ -1115,32 +980,71 @@ module Google
|
|
1115
980
|
|
1116
981
|
# Update properties of this object
|
1117
982
|
def update!(**args)
|
1118
|
-
@
|
1119
|
-
@
|
1120
|
-
@
|
983
|
+
@image_context = args[:image_context] if args.key?(:image_context)
|
984
|
+
@image = args[:image] if args.key?(:image)
|
985
|
+
@features = args[:features] if args.key?(:features)
|
1121
986
|
end
|
1122
987
|
end
|
1123
988
|
|
1124
|
-
#
|
1125
|
-
#
|
1126
|
-
# The
|
1127
|
-
|
989
|
+
# The `Status` type defines a logical error model that is suitable for different
|
990
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
991
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
992
|
+
# - Simple to use and understand for most users
|
993
|
+
# - Flexible enough to meet unexpected needs
|
994
|
+
# # Overview
|
995
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
996
|
+
# and error details. The error code should be an enum value of
|
997
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
998
|
+
# error message should be a developer-facing English message that helps
|
999
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
1000
|
+
# error message is needed, put the localized message in the error details or
|
1001
|
+
# localize it in the client. The optional error details may contain arbitrary
|
1002
|
+
# information about the error. There is a predefined set of error detail types
|
1003
|
+
# in the package `google.rpc` which can be used for common error conditions.
|
1004
|
+
# # Language mapping
|
1005
|
+
# The `Status` message is the logical representation of the error model, but it
|
1006
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
1007
|
+
# exposed in different client libraries and different wire protocols, it can be
|
1008
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
1009
|
+
# in Java, but more likely mapped to some error codes in C.
|
1010
|
+
# # Other uses
|
1011
|
+
# The error model and the `Status` message can be used in a variety of
|
1012
|
+
# environments, either with or without APIs, to provide a
|
1013
|
+
# consistent developer experience across different environments.
|
1014
|
+
# Example uses of this error model include:
|
1015
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
1016
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
1017
|
+
# errors.
|
1018
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
1019
|
+
# have a `Status` message for error reporting purpose.
|
1020
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
1021
|
+
# `Status` message should be used directly inside batch response, one for
|
1022
|
+
# each error sub-response.
|
1023
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
1024
|
+
# results in its response, the status of those operations should be
|
1025
|
+
# represented directly using the `Status` message.
|
1026
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
1027
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
1028
|
+
class Status
|
1128
1029
|
include Google::Apis::Core::Hashable
|
1129
1030
|
|
1130
|
-
#
|
1131
|
-
#
|
1132
|
-
#
|
1133
|
-
|
1031
|
+
# A list of messages that carry the error details. There will be a
|
1032
|
+
# common set of message types for APIs to use.
|
1033
|
+
# Corresponds to the JSON property `details`
|
1034
|
+
# @return [Array<Hash<String,Object>>]
|
1035
|
+
attr_accessor :details
|
1134
1036
|
|
1135
|
-
#
|
1136
|
-
# Corresponds to the JSON property `
|
1137
|
-
# @return [
|
1138
|
-
attr_accessor :
|
1037
|
+
# The status code, which should be an enum value of google.rpc.Code.
|
1038
|
+
# Corresponds to the JSON property `code`
|
1039
|
+
# @return [Fixnum]
|
1040
|
+
attr_accessor :code
|
1139
1041
|
|
1140
|
-
#
|
1141
|
-
#
|
1142
|
-
#
|
1143
|
-
|
1042
|
+
# A developer-facing error message, which should be in English. Any
|
1043
|
+
# user-facing error message should be localized and sent in the
|
1044
|
+
# google.rpc.Status.details field, or localized by the client.
|
1045
|
+
# Corresponds to the JSON property `message`
|
1046
|
+
# @return [String]
|
1047
|
+
attr_accessor :message
|
1144
1048
|
|
1145
1049
|
def initialize(**args)
|
1146
1050
|
update!(**args)
|
@@ -1148,26 +1052,30 @@ module Google
|
|
1148
1052
|
|
1149
1053
|
# Update properties of this object
|
1150
1054
|
def update!(**args)
|
1151
|
-
@
|
1152
|
-
@
|
1153
|
-
@
|
1055
|
+
@details = args[:details] if args.key?(:details)
|
1056
|
+
@code = args[:code] if args.key?(:code)
|
1057
|
+
@message = args[:message] if args.key?(:message)
|
1154
1058
|
end
|
1155
1059
|
end
|
1156
1060
|
|
1157
|
-
#
|
1158
|
-
class
|
1061
|
+
# A single symbol representation.
|
1062
|
+
class Symbol
|
1159
1063
|
include Google::Apis::Core::Hashable
|
1160
1064
|
|
1161
|
-
#
|
1162
|
-
#
|
1163
|
-
#
|
1164
|
-
|
1165
|
-
attr_accessor :score
|
1065
|
+
# Additional information detected on the structural component.
|
1066
|
+
# Corresponds to the JSON property `property`
|
1067
|
+
# @return [Google::Apis::VisionV1::TextProperty]
|
1068
|
+
attr_accessor :property
|
1166
1069
|
|
1167
|
-
#
|
1168
|
-
# Corresponds to the JSON property `
|
1070
|
+
# A bounding polygon for the detected image annotation.
|
1071
|
+
# Corresponds to the JSON property `boundingBox`
|
1072
|
+
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1073
|
+
attr_accessor :bounding_box
|
1074
|
+
|
1075
|
+
# The actual UTF-8 representation of the symbol.
|
1076
|
+
# Corresponds to the JSON property `text`
|
1169
1077
|
# @return [String]
|
1170
|
-
attr_accessor :
|
1078
|
+
attr_accessor :text
|
1171
1079
|
|
1172
1080
|
def initialize(**args)
|
1173
1081
|
update!(**args)
|
@@ -1175,129 +1083,97 @@ module Google
|
|
1175
1083
|
|
1176
1084
|
# Update properties of this object
|
1177
1085
|
def update!(**args)
|
1178
|
-
@
|
1179
|
-
@
|
1086
|
+
@property = args[:property] if args.key?(:property)
|
1087
|
+
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
1088
|
+
@text = args[:text] if args.key?(:text)
|
1180
1089
|
end
|
1181
1090
|
end
|
1182
1091
|
|
1183
|
-
#
|
1184
|
-
|
1185
|
-
class ColorInfo
|
1092
|
+
# Rectangle determined by min and max `LatLng` pairs.
|
1093
|
+
class LatLongRect
|
1186
1094
|
include Google::Apis::Core::Hashable
|
1187
1095
|
|
1188
|
-
#
|
1189
|
-
#
|
1190
|
-
#
|
1191
|
-
|
1192
|
-
|
1193
|
-
#
|
1194
|
-
#
|
1195
|
-
#
|
1196
|
-
#
|
1197
|
-
|
1096
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1097
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1098
|
+
# specified otherwise, this must conform to the
|
1099
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1100
|
+
# standard</a>. Values must be within normalized ranges.
|
1101
|
+
# Example of normalization code in Python:
|
1102
|
+
# def NormalizeLongitude(longitude):
|
1103
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
1104
|
+
# q, r = divmod(longitude, 360.0)
|
1105
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
1106
|
+
# return r - 360.0
|
1107
|
+
# return r
|
1108
|
+
# def NormalizeLatLng(latitude, longitude):
|
1109
|
+
# """Wraps decimal degrees latitude and longitude to
|
1110
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1111
|
+
# r = latitude % 360.0
|
1112
|
+
# if r <= 90.0:
|
1113
|
+
# return r, NormalizeLongitude(longitude)
|
1114
|
+
# elif r >= 270.0:
|
1115
|
+
# return r - 360, NormalizeLongitude(longitude)
|
1116
|
+
# else:
|
1117
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1118
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
1119
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
1120
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
1121
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1122
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1123
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1124
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1125
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1126
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1127
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1128
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1129
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1130
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1131
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1132
|
+
# as if it were annotated as ST_LOCATION.
|
1133
|
+
# Corresponds to the JSON property `minLatLng`
|
1134
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
1135
|
+
attr_accessor :min_lat_lng
|
1198
1136
|
|
1199
|
-
#
|
1200
|
-
#
|
1201
|
-
#
|
1202
|
-
#
|
1203
|
-
#
|
1204
|
-
#
|
1205
|
-
#
|
1206
|
-
#
|
1207
|
-
#
|
1208
|
-
#
|
1209
|
-
#
|
1210
|
-
#
|
1211
|
-
#
|
1212
|
-
#
|
1213
|
-
#
|
1214
|
-
#
|
1215
|
-
#
|
1216
|
-
#
|
1217
|
-
#
|
1218
|
-
#
|
1219
|
-
#
|
1220
|
-
#
|
1221
|
-
#
|
1222
|
-
#
|
1223
|
-
#
|
1224
|
-
#
|
1225
|
-
#
|
1226
|
-
# .
|
1227
|
-
# .
|
1228
|
-
# .
|
1229
|
-
# .
|
1230
|
-
#
|
1231
|
-
#
|
1232
|
-
#
|
1233
|
-
#
|
1234
|
-
# .
|
1235
|
-
#
|
1236
|
-
#
|
1237
|
-
#
|
1238
|
-
|
1239
|
-
# `
|
1240
|
-
# // ...
|
1241
|
-
# Example (iOS / Obj-C):
|
1242
|
-
# // ...
|
1243
|
-
# static UIColor* fromProto(Color* protocolor) `
|
1244
|
-
# float red = [protocolor red];
|
1245
|
-
# float green = [protocolor green];
|
1246
|
-
# float blue = [protocolor blue];
|
1247
|
-
# FloatValue* alpha_wrapper = [protocolor alpha];
|
1248
|
-
# float alpha = 1.0;
|
1249
|
-
# if (alpha_wrapper != nil) `
|
1250
|
-
# alpha = [alpha_wrapper value];
|
1251
|
-
# `
|
1252
|
-
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
1253
|
-
# `
|
1254
|
-
# static Color* toProto(UIColor* color) `
|
1255
|
-
# CGFloat red, green, blue, alpha;
|
1256
|
-
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
1257
|
-
# return nil;
|
1258
|
-
# `
|
1259
|
-
# Color* result = [Color alloc] init];
|
1260
|
-
# [result setRed:red];
|
1261
|
-
# [result setGreen:green];
|
1262
|
-
# [result setBlue:blue];
|
1263
|
-
# if (alpha <= 0.9999) `
|
1264
|
-
# [result setAlpha:floatWrapperWithValue(alpha)];
|
1265
|
-
# `
|
1266
|
-
# [result autorelease];
|
1267
|
-
# return result;
|
1268
|
-
# `
|
1269
|
-
# // ...
|
1270
|
-
# Example (JavaScript):
|
1271
|
-
# // ...
|
1272
|
-
# var protoToCssColor = function(rgb_color) `
|
1273
|
-
# var redFrac = rgb_color.red || 0.0;
|
1274
|
-
# var greenFrac = rgb_color.green || 0.0;
|
1275
|
-
# var blueFrac = rgb_color.blue || 0.0;
|
1276
|
-
# var red = Math.floor(redFrac * 255);
|
1277
|
-
# var green = Math.floor(greenFrac * 255);
|
1278
|
-
# var blue = Math.floor(blueFrac * 255);
|
1279
|
-
# if (!('alpha' in rgb_color)) `
|
1280
|
-
# return rgbToCssColor_(red, green, blue);
|
1281
|
-
# `
|
1282
|
-
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
1283
|
-
# var rgbParams = [red, green, blue].join(',');
|
1284
|
-
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
1285
|
-
# `;
|
1286
|
-
# var rgbToCssColor_ = function(red, green, blue) `
|
1287
|
-
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
1288
|
-
# var hexString = rgbNumber.toString(16);
|
1289
|
-
# var missingZeros = 6 - hexString.length;
|
1290
|
-
# var resultBuilder = ['#'];
|
1291
|
-
# for (var i = 0; i < missingZeros; i++) `
|
1292
|
-
# resultBuilder.push('0');
|
1293
|
-
# `
|
1294
|
-
# resultBuilder.push(hexString);
|
1295
|
-
# return resultBuilder.join('');
|
1296
|
-
# `;
|
1297
|
-
# // ...
|
1298
|
-
# Corresponds to the JSON property `color`
|
1299
|
-
# @return [Google::Apis::VisionV1::Color]
|
1300
|
-
attr_accessor :color
|
1137
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1138
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1139
|
+
# specified otherwise, this must conform to the
|
1140
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1141
|
+
# standard</a>. Values must be within normalized ranges.
|
1142
|
+
# Example of normalization code in Python:
|
1143
|
+
# def NormalizeLongitude(longitude):
|
1144
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
1145
|
+
# q, r = divmod(longitude, 360.0)
|
1146
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
1147
|
+
# return r - 360.0
|
1148
|
+
# return r
|
1149
|
+
# def NormalizeLatLng(latitude, longitude):
|
1150
|
+
# """Wraps decimal degrees latitude and longitude to
|
1151
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1152
|
+
# r = latitude % 360.0
|
1153
|
+
# if r <= 90.0:
|
1154
|
+
# return r, NormalizeLongitude(longitude)
|
1155
|
+
# elif r >= 270.0:
|
1156
|
+
# return r - 360, NormalizeLongitude(longitude)
|
1157
|
+
# else:
|
1158
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1159
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
1160
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
1161
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
1162
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1163
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1164
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1165
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1166
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1167
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1168
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1169
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1170
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1171
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1172
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1173
|
+
# as if it were annotated as ST_LOCATION.
|
1174
|
+
# Corresponds to the JSON property `maxLatLng`
|
1175
|
+
# @return [Google::Apis::VisionV1::LatLng]
|
1176
|
+
attr_accessor :max_lat_lng
|
1301
1177
|
|
1302
1178
|
def initialize(**args)
|
1303
1179
|
update!(**args)
|
@@ -1305,75 +1181,79 @@ module Google
|
|
1305
1181
|
|
1306
1182
|
# Update properties of this object
|
1307
1183
|
def update!(**args)
|
1308
|
-
@
|
1309
|
-
@
|
1310
|
-
@color = args[:color] if args.key?(:color)
|
1184
|
+
@min_lat_lng = args[:min_lat_lng] if args.key?(:min_lat_lng)
|
1185
|
+
@max_lat_lng = args[:max_lat_lng] if args.key?(:max_lat_lng)
|
1311
1186
|
end
|
1312
1187
|
end
|
1313
1188
|
|
1314
|
-
# Set of
|
1315
|
-
class
|
1189
|
+
# Set of crop hints that are used to generate new crops when serving images.
|
1190
|
+
class CropHintsAnnotation
|
1316
1191
|
include Google::Apis::Core::Hashable
|
1317
1192
|
|
1318
|
-
#
|
1319
|
-
#
|
1320
|
-
#
|
1321
|
-
|
1322
|
-
# @return [String]
|
1323
|
-
attr_accessor :mid
|
1324
|
-
|
1325
|
-
# The accuracy of the entity detection in an image.
|
1326
|
-
# For example, for an image in which the "Eiffel Tower" entity is detected,
|
1327
|
-
# this field represents the confidence that there is a tower in the query
|
1328
|
-
# image. Range [0, 1].
|
1329
|
-
# Corresponds to the JSON property `confidence`
|
1330
|
-
# @return [Float]
|
1331
|
-
attr_accessor :confidence
|
1193
|
+
# Crop hint results.
|
1194
|
+
# Corresponds to the JSON property `cropHints`
|
1195
|
+
# @return [Array<Google::Apis::VisionV1::CropHint>]
|
1196
|
+
attr_accessor :crop_hints
|
1332
1197
|
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
# @return [String]
|
1337
|
-
attr_accessor :locale
|
1198
|
+
def initialize(**args)
|
1199
|
+
update!(**args)
|
1200
|
+
end
|
1338
1201
|
|
1339
|
-
#
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1202
|
+
# Update properties of this object
|
1203
|
+
def update!(**args)
|
1204
|
+
@crop_hints = args[:crop_hints] if args.key?(:crop_hints)
|
1205
|
+
end
|
1206
|
+
end
|
1343
1207
|
|
1344
|
-
|
1345
|
-
|
1346
|
-
|
1347
|
-
|
1208
|
+
# An object representing a latitude/longitude pair. This is expressed as a pair
|
1209
|
+
# of doubles representing degrees latitude and degrees longitude. Unless
|
1210
|
+
# specified otherwise, this must conform to the
|
1211
|
+
# <a href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
|
1212
|
+
# standard</a>. Values must be within normalized ranges.
|
1213
|
+
# Example of normalization code in Python:
|
1214
|
+
# def NormalizeLongitude(longitude):
|
1215
|
+
# """Wraps decimal degrees longitude to [-180.0, 180.0]."""
|
1216
|
+
# q, r = divmod(longitude, 360.0)
|
1217
|
+
# if r > 180.0 or (r == 180.0 and q <= -1.0):
|
1218
|
+
# return r - 360.0
|
1219
|
+
# return r
|
1220
|
+
# def NormalizeLatLng(latitude, longitude):
|
1221
|
+
# """Wraps decimal degrees latitude and longitude to
|
1222
|
+
# [-90.0, 90.0] and [-180.0, 180.0], respectively."""
|
1223
|
+
# r = latitude % 360.0
|
1224
|
+
# if r <= 90.0:
|
1225
|
+
# return r, NormalizeLongitude(longitude)
|
1226
|
+
# elif r >= 270.0:
|
1227
|
+
# return r - 360, NormalizeLongitude(longitude)
|
1228
|
+
# else:
|
1229
|
+
# return 180 - r, NormalizeLongitude(longitude + 180.0)
|
1230
|
+
# assert 180.0 == NormalizeLongitude(180.0)
|
1231
|
+
# assert -180.0 == NormalizeLongitude(-180.0)
|
1232
|
+
# assert -179.0 == NormalizeLongitude(181.0)
|
1233
|
+
# assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0)
|
1234
|
+
# assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0)
|
1235
|
+
# assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0)
|
1236
|
+
# assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0)
|
1237
|
+
# assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0)
|
1238
|
+
# assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0)
|
1239
|
+
# assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0)
|
1240
|
+
# assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0)
|
1241
|
+
# assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0)
|
1242
|
+
# assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0)
|
1243
|
+
# The code in logs/storage/validator/logs_validator_traits.cc treats this type
|
1244
|
+
# as if it were annotated as ST_LOCATION.
|
1245
|
+
class LatLng
|
1246
|
+
include Google::Apis::Core::Hashable
|
1348
1247
|
|
1349
|
-
# The
|
1350
|
-
#
|
1351
|
-
# containing the detected "Eiffel Tower" than to an image containing a
|
1352
|
-
# detected distant towering building, even though the confidence that
|
1353
|
-
# there is a tower in each image may be the same. Range [0, 1].
|
1354
|
-
# Corresponds to the JSON property `topicality`
|
1248
|
+
# The latitude in degrees. It must be in the range [-90.0, +90.0].
|
1249
|
+
# Corresponds to the JSON property `latitude`
|
1355
1250
|
# @return [Float]
|
1356
|
-
attr_accessor :
|
1357
|
-
|
1358
|
-
# Some entities may have optional user-supplied `Property` (name/value)
|
1359
|
-
# fields, such a score or string that qualifies the entity.
|
1360
|
-
# Corresponds to the JSON property `properties`
|
1361
|
-
# @return [Array<Google::Apis::VisionV1::Property>]
|
1362
|
-
attr_accessor :properties
|
1251
|
+
attr_accessor :latitude
|
1363
1252
|
|
1364
|
-
#
|
1365
|
-
# Corresponds to the JSON property `
|
1253
|
+
# The longitude in degrees. It must be in the range [-180.0, +180.0].
|
1254
|
+
# Corresponds to the JSON property `longitude`
|
1366
1255
|
# @return [Float]
|
1367
|
-
attr_accessor :
|
1368
|
-
|
1369
|
-
# The location information for the detected entity. Multiple
|
1370
|
-
# `LocationInfo` elements can be present because one location may
|
1371
|
-
# indicate the location of the scene in the image, and another location
|
1372
|
-
# may indicate the location of the place where the image was taken.
|
1373
|
-
# Location information is usually present for landmarks.
|
1374
|
-
# Corresponds to the JSON property `locations`
|
1375
|
-
# @return [Array<Google::Apis::VisionV1::LocationInfo>]
|
1376
|
-
attr_accessor :locations
|
1256
|
+
attr_accessor :longitude
|
1377
1257
|
|
1378
1258
|
def initialize(**args)
|
1379
1259
|
update!(**args)
|
@@ -1381,37 +1261,140 @@ module Google
|
|
1381
1261
|
|
1382
1262
|
# Update properties of this object
|
1383
1263
|
def update!(**args)
|
1384
|
-
@
|
1385
|
-
@
|
1386
|
-
@locale = args[:locale] if args.key?(:locale)
|
1387
|
-
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1388
|
-
@description = args[:description] if args.key?(:description)
|
1389
|
-
@topicality = args[:topicality] if args.key?(:topicality)
|
1390
|
-
@properties = args[:properties] if args.key?(:properties)
|
1391
|
-
@score = args[:score] if args.key?(:score)
|
1392
|
-
@locations = args[:locations] if args.key?(:locations)
|
1264
|
+
@latitude = args[:latitude] if args.key?(:latitude)
|
1265
|
+
@longitude = args[:longitude] if args.key?(:longitude)
|
1393
1266
|
end
|
1394
1267
|
end
|
1395
1268
|
|
1396
|
-
#
|
1397
|
-
|
1269
|
+
# Represents a color in the RGBA color space. This representation is designed
|
1270
|
+
# for simplicity of conversion to/from color representations in various
|
1271
|
+
# languages over compactness; for example, the fields of this representation
|
1272
|
+
# can be trivially provided to the constructor of "java.awt.Color" in Java; it
|
1273
|
+
# can also be trivially provided to UIColor's "+colorWithRed:green:blue:alpha"
|
1274
|
+
# method in iOS; and, with just a little work, it can be easily formatted into
|
1275
|
+
# a CSS "rgba()" string in JavaScript, as well. Here are some examples:
|
1276
|
+
# Example (Java):
|
1277
|
+
# import com.google.type.Color;
|
1278
|
+
# // ...
|
1279
|
+
# public static java.awt.Color fromProto(Color protocolor) `
|
1280
|
+
# float alpha = protocolor.hasAlpha()
|
1281
|
+
# ? protocolor.getAlpha().getValue()
|
1282
|
+
# : 1.0;
|
1283
|
+
# return new java.awt.Color(
|
1284
|
+
# protocolor.getRed(),
|
1285
|
+
# protocolor.getGreen(),
|
1286
|
+
# protocolor.getBlue(),
|
1287
|
+
# alpha);
|
1288
|
+
# `
|
1289
|
+
# public static Color toProto(java.awt.Color color) `
|
1290
|
+
# float red = (float) color.getRed();
|
1291
|
+
# float green = (float) color.getGreen();
|
1292
|
+
# float blue = (float) color.getBlue();
|
1293
|
+
# float denominator = 255.0;
|
1294
|
+
# Color.Builder resultBuilder =
|
1295
|
+
# Color
|
1296
|
+
# .newBuilder()
|
1297
|
+
# .setRed(red / denominator)
|
1298
|
+
# .setGreen(green / denominator)
|
1299
|
+
# .setBlue(blue / denominator);
|
1300
|
+
# int alpha = color.getAlpha();
|
1301
|
+
# if (alpha != 255) `
|
1302
|
+
# result.setAlpha(
|
1303
|
+
# FloatValue
|
1304
|
+
# .newBuilder()
|
1305
|
+
# .setValue(((float) alpha) / denominator)
|
1306
|
+
# .build());
|
1307
|
+
# `
|
1308
|
+
# return resultBuilder.build();
|
1309
|
+
# `
|
1310
|
+
# // ...
|
1311
|
+
# Example (iOS / Obj-C):
|
1312
|
+
# // ...
|
1313
|
+
# static UIColor* fromProto(Color* protocolor) `
|
1314
|
+
# float red = [protocolor red];
|
1315
|
+
# float green = [protocolor green];
|
1316
|
+
# float blue = [protocolor blue];
|
1317
|
+
# FloatValue* alpha_wrapper = [protocolor alpha];
|
1318
|
+
# float alpha = 1.0;
|
1319
|
+
# if (alpha_wrapper != nil) `
|
1320
|
+
# alpha = [alpha_wrapper value];
|
1321
|
+
# `
|
1322
|
+
# return [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
|
1323
|
+
# `
|
1324
|
+
# static Color* toProto(UIColor* color) `
|
1325
|
+
# CGFloat red, green, blue, alpha;
|
1326
|
+
# if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) `
|
1327
|
+
# return nil;
|
1328
|
+
# `
|
1329
|
+
# Color* result = [Color alloc] init];
|
1330
|
+
# [result setRed:red];
|
1331
|
+
# [result setGreen:green];
|
1332
|
+
# [result setBlue:blue];
|
1333
|
+
# if (alpha <= 0.9999) `
|
1334
|
+
# [result setAlpha:floatWrapperWithValue(alpha)];
|
1335
|
+
# `
|
1336
|
+
# [result autorelease];
|
1337
|
+
# return result;
|
1338
|
+
# `
|
1339
|
+
# // ...
|
1340
|
+
# Example (JavaScript):
|
1341
|
+
# // ...
|
1342
|
+
# var protoToCssColor = function(rgb_color) `
|
1343
|
+
# var redFrac = rgb_color.red || 0.0;
|
1344
|
+
# var greenFrac = rgb_color.green || 0.0;
|
1345
|
+
# var blueFrac = rgb_color.blue || 0.0;
|
1346
|
+
# var red = Math.floor(redFrac * 255);
|
1347
|
+
# var green = Math.floor(greenFrac * 255);
|
1348
|
+
# var blue = Math.floor(blueFrac * 255);
|
1349
|
+
# if (!('alpha' in rgb_color)) `
|
1350
|
+
# return rgbToCssColor_(red, green, blue);
|
1351
|
+
# `
|
1352
|
+
# var alphaFrac = rgb_color.alpha.value || 0.0;
|
1353
|
+
# var rgbParams = [red, green, blue].join(',');
|
1354
|
+
# return ['rgba(', rgbParams, ',', alphaFrac, ')'].join('');
|
1355
|
+
# `;
|
1356
|
+
# var rgbToCssColor_ = function(red, green, blue) `
|
1357
|
+
# var rgbNumber = new Number((red << 16) | (green << 8) | blue);
|
1358
|
+
# var hexString = rgbNumber.toString(16);
|
1359
|
+
# var missingZeros = 6 - hexString.length;
|
1360
|
+
# var resultBuilder = ['#'];
|
1361
|
+
# for (var i = 0; i < missingZeros; i++) `
|
1362
|
+
# resultBuilder.push('0');
|
1363
|
+
# `
|
1364
|
+
# resultBuilder.push(hexString);
|
1365
|
+
# return resultBuilder.join('');
|
1366
|
+
# `;
|
1367
|
+
# // ...
|
1368
|
+
class Color
|
1398
1369
|
include Google::Apis::Core::Hashable
|
1399
1370
|
|
1400
|
-
#
|
1401
|
-
# Corresponds to the JSON property `
|
1371
|
+
# The amount of red in the color as a value in the interval [0, 1].
|
1372
|
+
# Corresponds to the JSON property `red`
|
1402
1373
|
# @return [Float]
|
1403
|
-
attr_accessor :
|
1374
|
+
attr_accessor :red
|
1404
1375
|
|
1405
|
-
#
|
1406
|
-
#
|
1407
|
-
#
|
1376
|
+
# The amount of green in the color as a value in the interval [0, 1].
|
1377
|
+
# Corresponds to the JSON property `green`
|
1378
|
+
# @return [Float]
|
1379
|
+
attr_accessor :green
|
1380
|
+
|
1381
|
+
# The amount of blue in the color as a value in the interval [0, 1].
|
1382
|
+
# Corresponds to the JSON property `blue`
|
1383
|
+
# @return [Float]
|
1384
|
+
attr_accessor :blue
|
1385
|
+
|
1386
|
+
# The fraction of this color that should be applied to the pixel. That is,
|
1387
|
+
# the final pixel color is defined by the equation:
|
1388
|
+
# pixel color = alpha * (this color) + (1.0 - alpha) * (background color)
|
1389
|
+
# This means that a value of 1.0 corresponds to a solid color, whereas
|
1390
|
+
# a value of 0.0 corresponds to a completely transparent color. This
|
1391
|
+
# uses a wrapper message rather than a simple float scalar so that it is
|
1392
|
+
# possible to distinguish between a default value and the value being unset.
|
1393
|
+
# If omitted, this color object is to be rendered as a solid color
|
1394
|
+
# (as if the alpha value had been explicitly given with a value of 1.0).
|
1395
|
+
# Corresponds to the JSON property `alpha`
|
1408
1396
|
# @return [Float]
|
1409
|
-
attr_accessor :
|
1410
|
-
|
1411
|
-
# A bounding polygon for the detected image annotation.
|
1412
|
-
# Corresponds to the JSON property `boundingPoly`
|
1413
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1414
|
-
attr_accessor :bounding_poly
|
1397
|
+
attr_accessor :alpha
|
1415
1398
|
|
1416
1399
|
def initialize(**args)
|
1417
1400
|
update!(**args)
|
@@ -1419,31 +1402,21 @@ module Google
|
|
1419
1402
|
|
1420
1403
|
# Update properties of this object
|
1421
1404
|
def update!(**args)
|
1422
|
-
@
|
1423
|
-
@
|
1424
|
-
@
|
1405
|
+
@red = args[:red] if args.key?(:red)
|
1406
|
+
@green = args[:green] if args.key?(:green)
|
1407
|
+
@blue = args[:blue] if args.key?(:blue)
|
1408
|
+
@alpha = args[:alpha] if args.key?(:alpha)
|
1425
1409
|
end
|
1426
1410
|
end
|
1427
1411
|
|
1428
|
-
#
|
1429
|
-
|
1430
|
-
# if the face is near one or more edges of the image.
|
1431
|
-
# Therefore it is NOT guaranteed that `0 <= x < width` or
|
1432
|
-
# `0 <= y < height`.
|
1433
|
-
class Landmark
|
1412
|
+
# Stores image properties, such as dominant colors.
|
1413
|
+
class ImageProperties
|
1434
1414
|
include Google::Apis::Core::Hashable
|
1435
1415
|
|
1436
|
-
#
|
1437
|
-
#
|
1438
|
-
#
|
1439
|
-
|
1440
|
-
# @return [Google::Apis::VisionV1::Position]
|
1441
|
-
attr_accessor :position
|
1442
|
-
|
1443
|
-
# Face landmark type.
|
1444
|
-
# Corresponds to the JSON property `type`
|
1445
|
-
# @return [String]
|
1446
|
-
attr_accessor :type
|
1416
|
+
# Set of dominant colors and their corresponding scores.
|
1417
|
+
# Corresponds to the JSON property `dominantColors`
|
1418
|
+
# @return [Google::Apis::VisionV1::DominantColorsAnnotation]
|
1419
|
+
attr_accessor :dominant_colors
|
1447
1420
|
|
1448
1421
|
def initialize(**args)
|
1449
1422
|
update!(**args)
|
@@ -1451,25 +1424,26 @@ module Google
|
|
1451
1424
|
|
1452
1425
|
# Update properties of this object
|
1453
1426
|
def update!(**args)
|
1454
|
-
@
|
1455
|
-
@type = args[:type] if args.key?(:type)
|
1427
|
+
@dominant_colors = args[:dominant_colors] if args.key?(:dominant_colors)
|
1456
1428
|
end
|
1457
1429
|
end
|
1458
1430
|
|
1459
|
-
#
|
1460
|
-
|
1431
|
+
# Users describe the type of Google Cloud Vision API tasks to perform over
|
1432
|
+
# images by using *Feature*s. Each Feature indicates a type of image
|
1433
|
+
# detection task to perform. Features encode the Cloud Vision API
|
1434
|
+
# vertical to operate on and the number of top-scoring results to return.
|
1435
|
+
class Feature
|
1461
1436
|
include Google::Apis::Core::Hashable
|
1462
1437
|
|
1463
|
-
#
|
1464
|
-
#
|
1465
|
-
# Corresponds to the JSON property `score`
|
1466
|
-
# @return [Float]
|
1467
|
-
attr_accessor :score
|
1468
|
-
|
1469
|
-
# The result image URL.
|
1470
|
-
# Corresponds to the JSON property `url`
|
1438
|
+
# The feature type.
|
1439
|
+
# Corresponds to the JSON property `type`
|
1471
1440
|
# @return [String]
|
1472
|
-
attr_accessor :
|
1441
|
+
attr_accessor :type
|
1442
|
+
|
1443
|
+
# Maximum number of results of this type.
|
1444
|
+
# Corresponds to the JSON property `maxResults`
|
1445
|
+
# @return [Fixnum]
|
1446
|
+
attr_accessor :max_results
|
1473
1447
|
|
1474
1448
|
def initialize(**args)
|
1475
1449
|
update!(**args)
|
@@ -1477,30 +1451,38 @@ module Google
|
|
1477
1451
|
|
1478
1452
|
# Update properties of this object
|
1479
1453
|
def update!(**args)
|
1480
|
-
@
|
1481
|
-
@
|
1454
|
+
@type = args[:type] if args.key?(:type)
|
1455
|
+
@max_results = args[:max_results] if args.key?(:max_results)
|
1482
1456
|
end
|
1483
1457
|
end
|
1484
1458
|
|
1485
|
-
#
|
1486
|
-
|
1459
|
+
# Set of features pertaining to the image, computed by computer vision
|
1460
|
+
# methods over safe-search verticals (for example, adult, spoof, medical,
|
1461
|
+
# violence).
|
1462
|
+
class SafeSearchAnnotation
|
1487
1463
|
include Google::Apis::Core::Hashable
|
1488
1464
|
|
1489
|
-
#
|
1490
|
-
# Corresponds to the JSON property `
|
1491
|
-
# @return [
|
1492
|
-
attr_accessor :
|
1465
|
+
# Violence likelihood.
|
1466
|
+
# Corresponds to the JSON property `violence`
|
1467
|
+
# @return [String]
|
1468
|
+
attr_accessor :violence
|
1493
1469
|
|
1494
|
-
#
|
1495
|
-
#
|
1496
|
-
#
|
1497
|
-
|
1498
|
-
attr_accessor :symbols
|
1470
|
+
# Represents the adult content likelihood for the image.
|
1471
|
+
# Corresponds to the JSON property `adult`
|
1472
|
+
# @return [String]
|
1473
|
+
attr_accessor :adult
|
1499
1474
|
|
1500
|
-
#
|
1501
|
-
#
|
1502
|
-
#
|
1503
|
-
|
1475
|
+
# Spoof likelihood. The likelihood that an modification
|
1476
|
+
# was made to the image's canonical version to make it appear
|
1477
|
+
# funny or offensive.
|
1478
|
+
# Corresponds to the JSON property `spoof`
|
1479
|
+
# @return [String]
|
1480
|
+
attr_accessor :spoof
|
1481
|
+
|
1482
|
+
# Likelihood that this is a medical image.
|
1483
|
+
# Corresponds to the JSON property `medical`
|
1484
|
+
# @return [String]
|
1485
|
+
attr_accessor :medical
|
1504
1486
|
|
1505
1487
|
def initialize(**args)
|
1506
1488
|
update!(**args)
|
@@ -1508,30 +1490,21 @@ module Google
|
|
1508
1490
|
|
1509
1491
|
# Update properties of this object
|
1510
1492
|
def update!(**args)
|
1511
|
-
@
|
1512
|
-
@
|
1513
|
-
@
|
1493
|
+
@violence = args[:violence] if args.key?(:violence)
|
1494
|
+
@adult = args[:adult] if args.key?(:adult)
|
1495
|
+
@spoof = args[:spoof] if args.key?(:spoof)
|
1496
|
+
@medical = args[:medical] if args.key?(:medical)
|
1514
1497
|
end
|
1515
1498
|
end
|
1516
1499
|
|
1517
|
-
#
|
1518
|
-
class
|
1500
|
+
# Set of dominant colors and their corresponding scores.
|
1501
|
+
class DominantColorsAnnotation
|
1519
1502
|
include Google::Apis::Core::Hashable
|
1520
1503
|
|
1521
|
-
#
|
1522
|
-
# Corresponds to the JSON property `
|
1523
|
-
# @return [Google::Apis::VisionV1::
|
1524
|
-
attr_accessor :
|
1525
|
-
|
1526
|
-
# A bounding polygon for the detected image annotation.
|
1527
|
-
# Corresponds to the JSON property `boundingBox`
|
1528
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1529
|
-
attr_accessor :bounding_box
|
1530
|
-
|
1531
|
-
# List of words in this paragraph.
|
1532
|
-
# Corresponds to the JSON property `words`
|
1533
|
-
# @return [Array<Google::Apis::VisionV1::Word>]
|
1534
|
-
attr_accessor :words
|
1504
|
+
# RGB color values with their score and pixel fraction.
|
1505
|
+
# Corresponds to the JSON property `colors`
|
1506
|
+
# @return [Array<Google::Apis::VisionV1::ColorInfo>]
|
1507
|
+
attr_accessor :colors
|
1535
1508
|
|
1536
1509
|
def initialize(**args)
|
1537
1510
|
update!(**args)
|
@@ -1539,27 +1512,29 @@ module Google
|
|
1539
1512
|
|
1540
1513
|
# Update properties of this object
|
1541
1514
|
def update!(**args)
|
1542
|
-
@
|
1543
|
-
@bounding_box = args[:bounding_box] if args.key?(:bounding_box)
|
1544
|
-
@words = args[:words] if args.key?(:words)
|
1515
|
+
@colors = args[:colors] if args.key?(:colors)
|
1545
1516
|
end
|
1546
1517
|
end
|
1547
1518
|
|
1548
|
-
#
|
1549
|
-
|
1519
|
+
# TextAnnotation contains a structured representation of OCR extracted text.
|
1520
|
+
# The hierarchy of an OCR extracted text structure is like this:
|
1521
|
+
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
1522
|
+
# Each structural component, starting from Page, may further have their own
|
1523
|
+
# properties. Properties describe detected languages, breaks etc.. Please
|
1524
|
+
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
1525
|
+
# definition below for more detail.
|
1526
|
+
class TextAnnotation
|
1550
1527
|
include Google::Apis::Core::Hashable
|
1551
1528
|
|
1552
|
-
#
|
1553
|
-
#
|
1554
|
-
#
|
1555
|
-
|
1556
|
-
# @return [String]
|
1557
|
-
attr_accessor :content
|
1529
|
+
# List of pages detected by OCR.
|
1530
|
+
# Corresponds to the JSON property `pages`
|
1531
|
+
# @return [Array<Google::Apis::VisionV1::Page>]
|
1532
|
+
attr_accessor :pages
|
1558
1533
|
|
1559
|
-
#
|
1560
|
-
# Corresponds to the JSON property `
|
1561
|
-
# @return [
|
1562
|
-
attr_accessor :
|
1534
|
+
# UTF-8 text detected on the pages.
|
1535
|
+
# Corresponds to the JSON property `text`
|
1536
|
+
# @return [String]
|
1537
|
+
attr_accessor :text
|
1563
1538
|
|
1564
1539
|
def initialize(**args)
|
1565
1540
|
update!(**args)
|
@@ -1567,94 +1542,52 @@ module Google
|
|
1567
1542
|
|
1568
1543
|
# Update properties of this object
|
1569
1544
|
def update!(**args)
|
1570
|
-
@
|
1571
|
-
@
|
1545
|
+
@pages = args[:pages] if args.key?(:pages)
|
1546
|
+
@text = args[:text] if args.key?(:text)
|
1572
1547
|
end
|
1573
1548
|
end
|
1574
1549
|
|
1575
|
-
#
|
1576
|
-
class
|
1550
|
+
# Detected language for a structural component.
|
1551
|
+
class DetectedLanguage
|
1577
1552
|
include Google::Apis::Core::Hashable
|
1578
1553
|
|
1579
|
-
#
|
1580
|
-
#
|
1581
|
-
#
|
1582
|
-
#
|
1583
|
-
attr_accessor :tilt_angle
|
1584
|
-
|
1585
|
-
# A bounding polygon for the detected image annotation.
|
1586
|
-
# Corresponds to the JSON property `fdBoundingPoly`
|
1587
|
-
# @return [Google::Apis::VisionV1::BoundingPoly]
|
1588
|
-
attr_accessor :fd_bounding_poly
|
1589
|
-
|
1590
|
-
# Anger likelihood.
|
1591
|
-
# Corresponds to the JSON property `angerLikelihood`
|
1592
|
-
# @return [String]
|
1593
|
-
attr_accessor :anger_likelihood
|
1594
|
-
|
1595
|
-
# Detected face landmarks.
|
1596
|
-
# Corresponds to the JSON property `landmarks`
|
1597
|
-
# @return [Array<Google::Apis::VisionV1::Landmark>]
|
1598
|
-
attr_accessor :landmarks
|
1599
|
-
|
1600
|
-
# Surprise likelihood.
|
1601
|
-
# Corresponds to the JSON property `surpriseLikelihood`
|
1602
|
-
# @return [String]
|
1603
|
-
attr_accessor :surprise_likelihood
|
1604
|
-
|
1605
|
-
# Face landmarking confidence. Range [0, 1].
|
1606
|
-
# Corresponds to the JSON property `landmarkingConfidence`
|
1607
|
-
# @return [Float]
|
1608
|
-
attr_accessor :landmarking_confidence
|
1609
|
-
|
1610
|
-
# Joy likelihood.
|
1611
|
-
# Corresponds to the JSON property `joyLikelihood`
|
1554
|
+
# The BCP-47 language code, such as "en-US" or "sr-Latn". For more
|
1555
|
+
# information, see
|
1556
|
+
# http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
|
1557
|
+
# Corresponds to the JSON property `languageCode`
|
1612
1558
|
# @return [String]
|
1613
|
-
attr_accessor :
|
1614
|
-
|
1615
|
-
# Detection confidence. Range [0, 1].
|
1616
|
-
# Corresponds to the JSON property `detectionConfidence`
|
1617
|
-
# @return [Float]
|
1618
|
-
attr_accessor :detection_confidence
|
1559
|
+
attr_accessor :language_code
|
1619
1560
|
|
1620
|
-
#
|
1621
|
-
#
|
1622
|
-
# [-180,180].
|
1623
|
-
# Corresponds to the JSON property `panAngle`
|
1561
|
+
# Confidence of detected language. Range [0, 1].
|
1562
|
+
# Corresponds to the JSON property `confidence`
|
1624
1563
|
# @return [Float]
|
1625
|
-
attr_accessor :
|
1626
|
-
|
1627
|
-
# Under-exposed likelihood.
|
1628
|
-
# Corresponds to the JSON property `underExposedLikelihood`
|
1629
|
-
# @return [String]
|
1630
|
-
attr_accessor :under_exposed_likelihood
|
1631
|
-
|
1632
|
-
# Blurred likelihood.
|
1633
|
-
# Corresponds to the JSON property `blurredLikelihood`
|
1634
|
-
# @return [String]
|
1635
|
-
attr_accessor :blurred_likelihood
|
1564
|
+
attr_accessor :confidence
|
1636
1565
|
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
attr_accessor :headwear_likelihood
|
1566
|
+
def initialize(**args)
|
1567
|
+
update!(**args)
|
1568
|
+
end
|
1641
1569
|
|
1642
|
-
#
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1570
|
+
# Update properties of this object
|
1571
|
+
def update!(**args)
|
1572
|
+
@language_code = args[:language_code] if args.key?(:language_code)
|
1573
|
+
@confidence = args[:confidence] if args.key?(:confidence)
|
1574
|
+
end
|
1575
|
+
end
|
1646
1576
|
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
# @return [Float]
|
1652
|
-
attr_accessor :roll_angle
|
1577
|
+
# A vertex represents a 2D point in the image.
|
1578
|
+
# NOTE: the vertex coordinates are in the same scale as the original image.
|
1579
|
+
class Vertex
|
1580
|
+
include Google::Apis::Core::Hashable
|
1653
1581
|
|
1654
|
-
#
|
1655
|
-
# Corresponds to the JSON property `
|
1656
|
-
# @return [
|
1657
|
-
attr_accessor :
|
1582
|
+
# Y coordinate.
|
1583
|
+
# Corresponds to the JSON property `y`
|
1584
|
+
# @return [Fixnum]
|
1585
|
+
attr_accessor :y
|
1586
|
+
|
1587
|
+
# X coordinate.
|
1588
|
+
# Corresponds to the JSON property `x`
|
1589
|
+
# @return [Fixnum]
|
1590
|
+
attr_accessor :x
|
1658
1591
|
|
1659
1592
|
def initialize(**args)
|
1660
1593
|
update!(**args)
|
@@ -1662,32 +1595,24 @@ module Google
|
|
1662
1595
|
|
1663
1596
|
# Update properties of this object
|
1664
1597
|
def update!(**args)
|
1665
|
-
@
|
1666
|
-
@
|
1667
|
-
@anger_likelihood = args[:anger_likelihood] if args.key?(:anger_likelihood)
|
1668
|
-
@landmarks = args[:landmarks] if args.key?(:landmarks)
|
1669
|
-
@surprise_likelihood = args[:surprise_likelihood] if args.key?(:surprise_likelihood)
|
1670
|
-
@landmarking_confidence = args[:landmarking_confidence] if args.key?(:landmarking_confidence)
|
1671
|
-
@joy_likelihood = args[:joy_likelihood] if args.key?(:joy_likelihood)
|
1672
|
-
@detection_confidence = args[:detection_confidence] if args.key?(:detection_confidence)
|
1673
|
-
@pan_angle = args[:pan_angle] if args.key?(:pan_angle)
|
1674
|
-
@under_exposed_likelihood = args[:under_exposed_likelihood] if args.key?(:under_exposed_likelihood)
|
1675
|
-
@blurred_likelihood = args[:blurred_likelihood] if args.key?(:blurred_likelihood)
|
1676
|
-
@headwear_likelihood = args[:headwear_likelihood] if args.key?(:headwear_likelihood)
|
1677
|
-
@bounding_poly = args[:bounding_poly] if args.key?(:bounding_poly)
|
1678
|
-
@roll_angle = args[:roll_angle] if args.key?(:roll_angle)
|
1679
|
-
@sorrow_likelihood = args[:sorrow_likelihood] if args.key?(:sorrow_likelihood)
|
1598
|
+
@y = args[:y] if args.key?(:y)
|
1599
|
+
@x = args[:x] if args.key?(:x)
|
1680
1600
|
end
|
1681
1601
|
end
|
1682
1602
|
|
1683
|
-
#
|
1684
|
-
class
|
1603
|
+
# Additional information detected on the structural component.
|
1604
|
+
class TextProperty
|
1685
1605
|
include Google::Apis::Core::Hashable
|
1686
1606
|
|
1687
|
-
#
|
1688
|
-
# Corresponds to the JSON property `
|
1689
|
-
# @return [Array<Google::Apis::VisionV1::
|
1690
|
-
attr_accessor :
|
1607
|
+
# A list of detected languages together with confidence.
|
1608
|
+
# Corresponds to the JSON property `detectedLanguages`
|
1609
|
+
# @return [Array<Google::Apis::VisionV1::DetectedLanguage>]
|
1610
|
+
attr_accessor :detected_languages
|
1611
|
+
|
1612
|
+
# Detected start or end of a structural component.
|
1613
|
+
# Corresponds to the JSON property `detectedBreak`
|
1614
|
+
# @return [Google::Apis::VisionV1::DetectedBreak]
|
1615
|
+
attr_accessor :detected_break
|
1691
1616
|
|
1692
1617
|
def initialize(**args)
|
1693
1618
|
update!(**args)
|
@@ -1695,24 +1620,19 @@ module Google
|
|
1695
1620
|
|
1696
1621
|
# Update properties of this object
|
1697
1622
|
def update!(**args)
|
1698
|
-
@
|
1623
|
+
@detected_languages = args[:detected_languages] if args.key?(:detected_languages)
|
1624
|
+
@detected_break = args[:detected_break] if args.key?(:detected_break)
|
1699
1625
|
end
|
1700
1626
|
end
|
1701
1627
|
|
1702
|
-
#
|
1703
|
-
class
|
1628
|
+
# A bounding polygon for the detected image annotation.
|
1629
|
+
class BoundingPoly
|
1704
1630
|
include Google::Apis::Core::Hashable
|
1705
1631
|
|
1706
|
-
#
|
1707
|
-
# Corresponds to the JSON property `
|
1708
|
-
# @return [
|
1709
|
-
attr_accessor :
|
1710
|
-
|
1711
|
-
# True if break prepends the element.
|
1712
|
-
# Corresponds to the JSON property `isPrefix`
|
1713
|
-
# @return [Boolean]
|
1714
|
-
attr_accessor :is_prefix
|
1715
|
-
alias_method :is_prefix?, :is_prefix
|
1632
|
+
# The bounding polygon vertices.
|
1633
|
+
# Corresponds to the JSON property `vertices`
|
1634
|
+
# @return [Array<Google::Apis::VisionV1::Vertex>]
|
1635
|
+
attr_accessor :vertices
|
1716
1636
|
|
1717
1637
|
def initialize(**args)
|
1718
1638
|
update!(**args)
|
@@ -1720,36 +1640,29 @@ module Google
|
|
1720
1640
|
|
1721
1641
|
# Update properties of this object
|
1722
1642
|
def update!(**args)
|
1723
|
-
@
|
1724
|
-
@is_prefix = args[:is_prefix] if args.key?(:is_prefix)
|
1643
|
+
@vertices = args[:vertices] if args.key?(:vertices)
|
1725
1644
|
end
|
1726
1645
|
end
|
1727
1646
|
|
1728
|
-
#
|
1729
|
-
class
|
1647
|
+
# Entity deduced from similar images on the Internet.
|
1648
|
+
class WebEntity
|
1730
1649
|
include Google::Apis::Core::Hashable
|
1731
1650
|
|
1732
|
-
#
|
1733
|
-
#
|
1734
|
-
#
|
1735
|
-
|
1736
|
-
# setting a hint will help get better results (although it will be a
|
1737
|
-
# significant hindrance if the hint is wrong). Text detection returns an
|
1738
|
-
# error if one or more of the specified languages is not one of the
|
1739
|
-
# [supported languages](/vision/docs/languages).
|
1740
|
-
# Corresponds to the JSON property `languageHints`
|
1741
|
-
# @return [Array<String>]
|
1742
|
-
attr_accessor :language_hints
|
1651
|
+
# Opaque entity ID.
|
1652
|
+
# Corresponds to the JSON property `entityId`
|
1653
|
+
# @return [String]
|
1654
|
+
attr_accessor :entity_id
|
1743
1655
|
|
1744
|
-
#
|
1745
|
-
# Corresponds to the JSON property `
|
1746
|
-
# @return [
|
1747
|
-
attr_accessor :
|
1656
|
+
# Canonical description of the entity, in English.
|
1657
|
+
# Corresponds to the JSON property `description`
|
1658
|
+
# @return [String]
|
1659
|
+
attr_accessor :description
|
1748
1660
|
|
1749
|
-
#
|
1750
|
-
#
|
1751
|
-
#
|
1752
|
-
|
1661
|
+
# Overall relevancy score for the entity.
|
1662
|
+
# Not normalized and not comparable across different image queries.
|
1663
|
+
# Corresponds to the JSON property `score`
|
1664
|
+
# @return [Float]
|
1665
|
+
attr_accessor :score
|
1753
1666
|
|
1754
1667
|
def initialize(**args)
|
1755
1668
|
update!(**args)
|
@@ -1757,35 +1670,116 @@ module Google
|
|
1757
1670
|
|
1758
1671
|
# Update properties of this object
|
1759
1672
|
def update!(**args)
|
1760
|
-
@
|
1761
|
-
@
|
1762
|
-
@
|
1673
|
+
@entity_id = args[:entity_id] if args.key?(:entity_id)
|
1674
|
+
@description = args[:description] if args.key?(:description)
|
1675
|
+
@score = args[:score] if args.key?(:score)
|
1763
1676
|
end
|
1764
1677
|
end
|
1765
1678
|
|
1766
|
-
#
|
1767
|
-
class
|
1679
|
+
# Response to an image annotation request.
|
1680
|
+
class AnnotateImageResponse
|
1768
1681
|
include Google::Apis::Core::Hashable
|
1769
1682
|
|
1770
|
-
#
|
1771
|
-
#
|
1772
|
-
#
|
1773
|
-
|
1683
|
+
# The `Status` type defines a logical error model that is suitable for different
|
1684
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
1685
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
1686
|
+
# - Simple to use and understand for most users
|
1687
|
+
# - Flexible enough to meet unexpected needs
|
1688
|
+
# # Overview
|
1689
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
1690
|
+
# and error details. The error code should be an enum value of
|
1691
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
1692
|
+
# error message should be a developer-facing English message that helps
|
1693
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
1694
|
+
# error message is needed, put the localized message in the error details or
|
1695
|
+
# localize it in the client. The optional error details may contain arbitrary
|
1696
|
+
# information about the error. There is a predefined set of error detail types
|
1697
|
+
# in the package `google.rpc` which can be used for common error conditions.
|
1698
|
+
# # Language mapping
|
1699
|
+
# The `Status` message is the logical representation of the error model, but it
|
1700
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
1701
|
+
# exposed in different client libraries and different wire protocols, it can be
|
1702
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
1703
|
+
# in Java, but more likely mapped to some error codes in C.
|
1704
|
+
# # Other uses
|
1705
|
+
# The error model and the `Status` message can be used in a variety of
|
1706
|
+
# environments, either with or without APIs, to provide a
|
1707
|
+
# consistent developer experience across different environments.
|
1708
|
+
# Example uses of this error model include:
|
1709
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
1710
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
1711
|
+
# errors.
|
1712
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
1713
|
+
# have a `Status` message for error reporting purpose.
|
1714
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
1715
|
+
# `Status` message should be used directly inside batch response, one for
|
1716
|
+
# each error sub-response.
|
1717
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
1718
|
+
# results in its response, the status of those operations should be
|
1719
|
+
# represented directly using the `Status` message.
|
1720
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
1721
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
1722
|
+
# Corresponds to the JSON property `error`
|
1723
|
+
# @return [Google::Apis::VisionV1::Status]
|
1724
|
+
attr_accessor :error
|
1774
1725
|
|
1775
|
-
#
|
1776
|
-
#
|
1777
|
-
#
|
1778
|
-
|
1726
|
+
# TextAnnotation contains a structured representation of OCR extracted text.
|
1727
|
+
# The hierarchy of an OCR extracted text structure is like this:
|
1728
|
+
# TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
|
1729
|
+
# Each structural component, starting from Page, may further have their own
|
1730
|
+
# properties. Properties describe detected languages, breaks etc.. Please
|
1731
|
+
# refer to the google.cloud.vision.v1.TextAnnotation.TextProperty message
|
1732
|
+
# definition below for more detail.
|
1733
|
+
# Corresponds to the JSON property `fullTextAnnotation`
|
1734
|
+
# @return [Google::Apis::VisionV1::TextAnnotation]
|
1735
|
+
attr_accessor :full_text_annotation
|
1779
1736
|
|
1780
|
-
#
|
1781
|
-
# Corresponds to the JSON property `
|
1782
|
-
# @return [Google::Apis::VisionV1::
|
1783
|
-
attr_accessor :
|
1737
|
+
# If present, landmark detection has completed successfully.
|
1738
|
+
# Corresponds to the JSON property `landmarkAnnotations`
|
1739
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
1740
|
+
attr_accessor :landmark_annotations
|
1784
1741
|
|
1785
|
-
#
|
1786
|
-
# Corresponds to the JSON property `
|
1787
|
-
# @return [
|
1788
|
-
attr_accessor :
|
1742
|
+
# If present, text (OCR) detection has completed successfully.
|
1743
|
+
# Corresponds to the JSON property `textAnnotations`
|
1744
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
1745
|
+
attr_accessor :text_annotations
|
1746
|
+
|
1747
|
+
# Stores image properties, such as dominant colors.
|
1748
|
+
# Corresponds to the JSON property `imagePropertiesAnnotation`
|
1749
|
+
# @return [Google::Apis::VisionV1::ImageProperties]
|
1750
|
+
attr_accessor :image_properties_annotation
|
1751
|
+
|
1752
|
+
# If present, face detection has completed successfully.
|
1753
|
+
# Corresponds to the JSON property `faceAnnotations`
|
1754
|
+
# @return [Array<Google::Apis::VisionV1::FaceAnnotation>]
|
1755
|
+
attr_accessor :face_annotations
|
1756
|
+
|
1757
|
+
# If present, logo detection has completed successfully.
|
1758
|
+
# Corresponds to the JSON property `logoAnnotations`
|
1759
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
1760
|
+
attr_accessor :logo_annotations
|
1761
|
+
|
1762
|
+
# Set of crop hints that are used to generate new crops when serving images.
|
1763
|
+
# Corresponds to the JSON property `cropHintsAnnotation`
|
1764
|
+
# @return [Google::Apis::VisionV1::CropHintsAnnotation]
|
1765
|
+
attr_accessor :crop_hints_annotation
|
1766
|
+
|
1767
|
+
# Relevant information for the image from the Internet.
|
1768
|
+
# Corresponds to the JSON property `webDetection`
|
1769
|
+
# @return [Google::Apis::VisionV1::WebDetection]
|
1770
|
+
attr_accessor :web_detection
|
1771
|
+
|
1772
|
+
# If present, label detection has completed successfully.
|
1773
|
+
# Corresponds to the JSON property `labelAnnotations`
|
1774
|
+
# @return [Array<Google::Apis::VisionV1::EntityAnnotation>]
|
1775
|
+
attr_accessor :label_annotations
|
1776
|
+
|
1777
|
+
# Set of features pertaining to the image, computed by computer vision
|
1778
|
+
# methods over safe-search verticals (for example, adult, spoof, medical,
|
1779
|
+
# violence).
|
1780
|
+
# Corresponds to the JSON property `safeSearchAnnotation`
|
1781
|
+
# @return [Google::Apis::VisionV1::SafeSearchAnnotation]
|
1782
|
+
attr_accessor :safe_search_annotation
|
1789
1783
|
|
1790
1784
|
def initialize(**args)
|
1791
1785
|
update!(**args)
|
@@ -1793,10 +1787,17 @@ module Google
|
|
1793
1787
|
|
1794
1788
|
# Update properties of this object
|
1795
1789
|
def update!(**args)
|
1796
|
-
@
|
1797
|
-
@
|
1798
|
-
@
|
1799
|
-
@
|
1790
|
+
@error = args[:error] if args.key?(:error)
|
1791
|
+
@full_text_annotation = args[:full_text_annotation] if args.key?(:full_text_annotation)
|
1792
|
+
@landmark_annotations = args[:landmark_annotations] if args.key?(:landmark_annotations)
|
1793
|
+
@text_annotations = args[:text_annotations] if args.key?(:text_annotations)
|
1794
|
+
@image_properties_annotation = args[:image_properties_annotation] if args.key?(:image_properties_annotation)
|
1795
|
+
@face_annotations = args[:face_annotations] if args.key?(:face_annotations)
|
1796
|
+
@logo_annotations = args[:logo_annotations] if args.key?(:logo_annotations)
|
1797
|
+
@crop_hints_annotation = args[:crop_hints_annotation] if args.key?(:crop_hints_annotation)
|
1798
|
+
@web_detection = args[:web_detection] if args.key?(:web_detection)
|
1799
|
+
@label_annotations = args[:label_annotations] if args.key?(:label_annotations)
|
1800
|
+
@safe_search_annotation = args[:safe_search_annotation] if args.key?(:safe_search_annotation)
|
1800
1801
|
end
|
1801
1802
|
end
|
1802
1803
|
end
|