google-cloud-automl 0.7.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/AUTHENTICATION.md +51 -54
- data/LICENSE.md +203 -0
- data/MIGRATING.md +324 -0
- data/README.md +36 -25
- data/lib/google-cloud-automl.rb +6 -2
- data/lib/google/cloud/automl.rb +132 -190
- data/lib/google/cloud/automl/version.rb +6 -2
- metadata +74 -110
- data/LICENSE +0 -201
- data/lib/google/cloud/automl/v1beta1.rb +0 -231
- data/lib/google/cloud/automl/v1beta1/annotation_payload_pb.rb +0 -34
- data/lib/google/cloud/automl/v1beta1/annotation_spec_pb.rb +0 -19
- data/lib/google/cloud/automl/v1beta1/automl_client.rb +0 -1909
- data/lib/google/cloud/automl/v1beta1/automl_client_config.json +0 -146
- data/lib/google/cloud/automl/v1beta1/automl_client_helpers.rb +0 -109
- data/lib/google/cloud/automl/v1beta1/classification_pb.rb +0 -66
- data/lib/google/cloud/automl/v1beta1/column_spec_pb.rb +0 -29
- data/lib/google/cloud/automl/v1beta1/credentials.rb +0 -41
- data/lib/google/cloud/automl/v1beta1/data_items_pb.rb +0 -88
- data/lib/google/cloud/automl/v1beta1/data_stats_pb.rb +0 -77
- data/lib/google/cloud/automl/v1beta1/data_types_pb.rb +0 -36
- data/lib/google/cloud/automl/v1beta1/dataset_pb.rb +0 -39
- data/lib/google/cloud/automl/v1beta1/detection_pb.rb +0 -52
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/annotation_payload.rb +0 -63
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/annotation_spec.rb +0 -39
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/classification.rb +0 -212
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/column_spec.rb +0 -67
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_items.rb +0 -202
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_stats.rb +0 -160
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/data_types.rb +0 -99
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/dataset.rb +0 -77
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/detection.rb +0 -130
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/geometry.rb +0 -43
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/image.rb +0 -183
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/io.rb +0 -1110
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/model.rb +0 -88
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/model_evaluation.rb +0 -96
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/prediction_service.rb +0 -186
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/ranges.rb +0 -31
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/regression.rb +0 -41
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/service.rb +0 -356
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/table_spec.rb +0 -68
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/tables.rb +0 -275
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/temporal.rb +0 -33
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text.rb +0 -54
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_extraction.rb +0 -60
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_segment.rb +0 -37
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/text_sentiment.rb +0 -76
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/translation.rb +0 -63
- data/lib/google/cloud/automl/v1beta1/doc/google/cloud/automl/v1beta1/video.rb +0 -35
- data/lib/google/cloud/automl/v1beta1/doc/google/longrunning/operations.rb +0 -51
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/any.rb +0 -131
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/field_mask.rb +0 -222
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/automl/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/automl/v1beta1/doc/google/rpc/status.rb +0 -39
- data/lib/google/cloud/automl/v1beta1/geometry_pb.rb +0 -21
- data/lib/google/cloud/automl/v1beta1/image_pb.rb +0 -50
- data/lib/google/cloud/automl/v1beta1/io_pb.rb +0 -80
- data/lib/google/cloud/automl/v1beta1/model_evaluation_pb.rb +0 -38
- data/lib/google/cloud/automl/v1beta1/model_pb.rb +0 -45
- data/lib/google/cloud/automl/v1beta1/operations_pb.rb +0 -90
- data/lib/google/cloud/automl/v1beta1/prediction_service_client.rb +0 -480
- data/lib/google/cloud/automl/v1beta1/prediction_service_client_config.json +0 -36
- data/lib/google/cloud/automl/v1beta1/prediction_service_pb.rb +0 -43
- data/lib/google/cloud/automl/v1beta1/prediction_service_services_pb.rb +0 -74
- data/lib/google/cloud/automl/v1beta1/ranges_pb.rb +0 -17
- data/lib/google/cloud/automl/v1beta1/regression_pb.rb +0 -20
- data/lib/google/cloud/automl/v1beta1/service_pb.rb +0 -180
- data/lib/google/cloud/automl/v1beta1/service_services_pb.rb +0 -158
- data/lib/google/cloud/automl/v1beta1/table_spec_pb.rb +0 -24
- data/lib/google/cloud/automl/v1beta1/tables_pb.rb +0 -58
- data/lib/google/cloud/automl/v1beta1/temporal_pb.rb +0 -18
- data/lib/google/cloud/automl/v1beta1/text_extraction_pb.rb +0 -32
- data/lib/google/cloud/automl/v1beta1/text_pb.rb +0 -34
- data/lib/google/cloud/automl/v1beta1/text_segment_pb.rb +0 -18
- data/lib/google/cloud/automl/v1beta1/text_sentiment_pb.rb +0 -29
- data/lib/google/cloud/automl/v1beta1/translation_pb.rb +0 -34
- data/lib/google/cloud/automl/v1beta1/video_pb.rb +0 -25
@@ -1,21 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/automl/v1beta1/geometry.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/api/annotations_pb'
|
8
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
-
add_message "google.cloud.automl.v1beta1.NormalizedVertex" do
|
10
|
-
optional :x, :float, 1
|
11
|
-
optional :y, :float, 2
|
12
|
-
end
|
13
|
-
add_message "google.cloud.automl.v1beta1.BoundingPoly" do
|
14
|
-
repeated :normalized_vertices, :message, 2, "google.cloud.automl.v1beta1.NormalizedVertex"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
module Google::Cloud::AutoML::V1beta1
|
19
|
-
NormalizedVertex = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.NormalizedVertex").msgclass
|
20
|
-
BoundingPoly = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BoundingPoly").msgclass
|
21
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/automl/v1beta1/image.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/api/resource_pb'
|
8
|
-
require 'google/cloud/automl/v1beta1/annotation_spec_pb'
|
9
|
-
require 'google/cloud/automl/v1beta1/classification_pb'
|
10
|
-
require 'google/protobuf/timestamp_pb'
|
11
|
-
require 'google/api/annotations_pb'
|
12
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
13
|
-
add_message "google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata" do
|
14
|
-
optional :classification_type, :enum, 1, "google.cloud.automl.v1beta1.ClassificationType"
|
15
|
-
end
|
16
|
-
add_message "google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata" do
|
17
|
-
end
|
18
|
-
add_message "google.cloud.automl.v1beta1.ImageClassificationModelMetadata" do
|
19
|
-
optional :base_model_id, :string, 1
|
20
|
-
optional :train_budget, :int64, 2
|
21
|
-
optional :train_cost, :int64, 3
|
22
|
-
optional :stop_reason, :string, 5
|
23
|
-
optional :model_type, :string, 7
|
24
|
-
optional :node_qps, :double, 13
|
25
|
-
optional :node_count, :int64, 14
|
26
|
-
end
|
27
|
-
add_message "google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata" do
|
28
|
-
optional :model_type, :string, 1
|
29
|
-
optional :node_count, :int64, 3
|
30
|
-
optional :node_qps, :double, 4
|
31
|
-
optional :stop_reason, :string, 5
|
32
|
-
optional :train_budget_milli_node_hours, :int64, 6
|
33
|
-
optional :train_cost_milli_node_hours, :int64, 7
|
34
|
-
end
|
35
|
-
add_message "google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata" do
|
36
|
-
optional :node_count, :int64, 1
|
37
|
-
end
|
38
|
-
add_message "google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata" do
|
39
|
-
optional :node_count, :int64, 1
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
module Google::Cloud::AutoML::V1beta1
|
44
|
-
ImageClassificationDatasetMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImageClassificationDatasetMetadata").msgclass
|
45
|
-
ImageObjectDetectionDatasetMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImageObjectDetectionDatasetMetadata").msgclass
|
46
|
-
ImageClassificationModelMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImageClassificationModelMetadata").msgclass
|
47
|
-
ImageObjectDetectionModelMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata").msgclass
|
48
|
-
ImageClassificationModelDeploymentMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImageClassificationModelDeploymentMetadata").msgclass
|
49
|
-
ImageObjectDetectionModelDeploymentMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImageObjectDetectionModelDeploymentMetadata").msgclass
|
50
|
-
end
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/automl/v1beta1/io.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/api/annotations_pb'
|
8
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
-
add_message "google.cloud.automl.v1beta1.InputConfig" do
|
10
|
-
map :params, :string, :string, 2
|
11
|
-
oneof :source do
|
12
|
-
optional :gcs_source, :message, 1, "google.cloud.automl.v1beta1.GcsSource"
|
13
|
-
optional :bigquery_source, :message, 3, "google.cloud.automl.v1beta1.BigQuerySource"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
add_message "google.cloud.automl.v1beta1.BatchPredictInputConfig" do
|
17
|
-
oneof :source do
|
18
|
-
optional :gcs_source, :message, 1, "google.cloud.automl.v1beta1.GcsSource"
|
19
|
-
optional :bigquery_source, :message, 2, "google.cloud.automl.v1beta1.BigQuerySource"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
add_message "google.cloud.automl.v1beta1.DocumentInputConfig" do
|
23
|
-
optional :gcs_source, :message, 1, "google.cloud.automl.v1beta1.GcsSource"
|
24
|
-
end
|
25
|
-
add_message "google.cloud.automl.v1beta1.OutputConfig" do
|
26
|
-
oneof :destination do
|
27
|
-
optional :gcs_destination, :message, 1, "google.cloud.automl.v1beta1.GcsDestination"
|
28
|
-
optional :bigquery_destination, :message, 2, "google.cloud.automl.v1beta1.BigQueryDestination"
|
29
|
-
end
|
30
|
-
end
|
31
|
-
add_message "google.cloud.automl.v1beta1.BatchPredictOutputConfig" do
|
32
|
-
oneof :destination do
|
33
|
-
optional :gcs_destination, :message, 1, "google.cloud.automl.v1beta1.GcsDestination"
|
34
|
-
optional :bigquery_destination, :message, 2, "google.cloud.automl.v1beta1.BigQueryDestination"
|
35
|
-
end
|
36
|
-
end
|
37
|
-
add_message "google.cloud.automl.v1beta1.ModelExportOutputConfig" do
|
38
|
-
optional :model_format, :string, 4
|
39
|
-
map :params, :string, :string, 2
|
40
|
-
oneof :destination do
|
41
|
-
optional :gcs_destination, :message, 1, "google.cloud.automl.v1beta1.GcsDestination"
|
42
|
-
optional :gcr_destination, :message, 3, "google.cloud.automl.v1beta1.GcrDestination"
|
43
|
-
end
|
44
|
-
end
|
45
|
-
add_message "google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig" do
|
46
|
-
oneof :destination do
|
47
|
-
optional :bigquery_destination, :message, 2, "google.cloud.automl.v1beta1.BigQueryDestination"
|
48
|
-
end
|
49
|
-
end
|
50
|
-
add_message "google.cloud.automl.v1beta1.GcsSource" do
|
51
|
-
repeated :input_uris, :string, 1
|
52
|
-
end
|
53
|
-
add_message "google.cloud.automl.v1beta1.BigQuerySource" do
|
54
|
-
optional :input_uri, :string, 1
|
55
|
-
end
|
56
|
-
add_message "google.cloud.automl.v1beta1.GcsDestination" do
|
57
|
-
optional :output_uri_prefix, :string, 1
|
58
|
-
end
|
59
|
-
add_message "google.cloud.automl.v1beta1.BigQueryDestination" do
|
60
|
-
optional :output_uri, :string, 1
|
61
|
-
end
|
62
|
-
add_message "google.cloud.automl.v1beta1.GcrDestination" do
|
63
|
-
optional :output_uri, :string, 1
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
module Google::Cloud::AutoML::V1beta1
|
68
|
-
InputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.InputConfig").msgclass
|
69
|
-
BatchPredictInputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BatchPredictInputConfig").msgclass
|
70
|
-
DocumentInputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.DocumentInputConfig").msgclass
|
71
|
-
OutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.OutputConfig").msgclass
|
72
|
-
BatchPredictOutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BatchPredictOutputConfig").msgclass
|
73
|
-
ModelExportOutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ModelExportOutputConfig").msgclass
|
74
|
-
ExportEvaluatedExamplesOutputConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportEvaluatedExamplesOutputConfig").msgclass
|
75
|
-
GcsSource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.GcsSource").msgclass
|
76
|
-
BigQuerySource = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BigQuerySource").msgclass
|
77
|
-
GcsDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.GcsDestination").msgclass
|
78
|
-
BigQueryDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BigQueryDestination").msgclass
|
79
|
-
GcrDestination = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.GcrDestination").msgclass
|
80
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/automl/v1beta1/model_evaluation.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/api/resource_pb'
|
8
|
-
require 'google/cloud/automl/v1beta1/classification_pb'
|
9
|
-
require 'google/cloud/automl/v1beta1/detection_pb'
|
10
|
-
require 'google/cloud/automl/v1beta1/regression_pb'
|
11
|
-
require 'google/cloud/automl/v1beta1/tables_pb'
|
12
|
-
require 'google/cloud/automl/v1beta1/text_extraction_pb'
|
13
|
-
require 'google/cloud/automl/v1beta1/text_sentiment_pb'
|
14
|
-
require 'google/cloud/automl/v1beta1/translation_pb'
|
15
|
-
require 'google/protobuf/timestamp_pb'
|
16
|
-
require 'google/api/annotations_pb'
|
17
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
18
|
-
add_message "google.cloud.automl.v1beta1.ModelEvaluation" do
|
19
|
-
optional :name, :string, 1
|
20
|
-
optional :annotation_spec_id, :string, 2
|
21
|
-
optional :display_name, :string, 15
|
22
|
-
optional :create_time, :message, 5, "google.protobuf.Timestamp"
|
23
|
-
optional :evaluated_example_count, :int32, 6
|
24
|
-
oneof :metrics do
|
25
|
-
optional :classification_evaluation_metrics, :message, 8, "google.cloud.automl.v1beta1.ClassificationEvaluationMetrics"
|
26
|
-
optional :regression_evaluation_metrics, :message, 24, "google.cloud.automl.v1beta1.RegressionEvaluationMetrics"
|
27
|
-
optional :translation_evaluation_metrics, :message, 9, "google.cloud.automl.v1beta1.TranslationEvaluationMetrics"
|
28
|
-
optional :image_object_detection_evaluation_metrics, :message, 12, "google.cloud.automl.v1beta1.ImageObjectDetectionEvaluationMetrics"
|
29
|
-
optional :video_object_tracking_evaluation_metrics, :message, 14, "google.cloud.automl.v1beta1.VideoObjectTrackingEvaluationMetrics"
|
30
|
-
optional :text_sentiment_evaluation_metrics, :message, 11, "google.cloud.automl.v1beta1.TextSentimentEvaluationMetrics"
|
31
|
-
optional :text_extraction_evaluation_metrics, :message, 13, "google.cloud.automl.v1beta1.TextExtractionEvaluationMetrics"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
module Google::Cloud::AutoML::V1beta1
|
37
|
-
ModelEvaluation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ModelEvaluation").msgclass
|
38
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/automl/v1beta1/model.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/api/resource_pb'
|
8
|
-
require 'google/cloud/automl/v1beta1/image_pb'
|
9
|
-
require 'google/cloud/automl/v1beta1/tables_pb'
|
10
|
-
require 'google/cloud/automl/v1beta1/text_pb'
|
11
|
-
require 'google/cloud/automl/v1beta1/translation_pb'
|
12
|
-
require 'google/cloud/automl/v1beta1/video_pb'
|
13
|
-
require 'google/protobuf/timestamp_pb'
|
14
|
-
require 'google/api/annotations_pb'
|
15
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
16
|
-
add_message "google.cloud.automl.v1beta1.Model" do
|
17
|
-
optional :name, :string, 1
|
18
|
-
optional :display_name, :string, 2
|
19
|
-
optional :dataset_id, :string, 3
|
20
|
-
optional :create_time, :message, 7, "google.protobuf.Timestamp"
|
21
|
-
optional :update_time, :message, 11, "google.protobuf.Timestamp"
|
22
|
-
optional :deployment_state, :enum, 8, "google.cloud.automl.v1beta1.Model.DeploymentState"
|
23
|
-
oneof :model_metadata do
|
24
|
-
optional :translation_model_metadata, :message, 15, "google.cloud.automl.v1beta1.TranslationModelMetadata"
|
25
|
-
optional :image_classification_model_metadata, :message, 13, "google.cloud.automl.v1beta1.ImageClassificationModelMetadata"
|
26
|
-
optional :text_classification_model_metadata, :message, 14, "google.cloud.automl.v1beta1.TextClassificationModelMetadata"
|
27
|
-
optional :image_object_detection_model_metadata, :message, 20, "google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata"
|
28
|
-
optional :video_classification_model_metadata, :message, 23, "google.cloud.automl.v1beta1.VideoClassificationModelMetadata"
|
29
|
-
optional :video_object_tracking_model_metadata, :message, 21, "google.cloud.automl.v1beta1.VideoObjectTrackingModelMetadata"
|
30
|
-
optional :text_extraction_model_metadata, :message, 19, "google.cloud.automl.v1beta1.TextExtractionModelMetadata"
|
31
|
-
optional :tables_model_metadata, :message, 24, "google.cloud.automl.v1beta1.TablesModelMetadata"
|
32
|
-
optional :text_sentiment_model_metadata, :message, 22, "google.cloud.automl.v1beta1.TextSentimentModelMetadata"
|
33
|
-
end
|
34
|
-
end
|
35
|
-
add_enum "google.cloud.automl.v1beta1.Model.DeploymentState" do
|
36
|
-
value :DEPLOYMENT_STATE_UNSPECIFIED, 0
|
37
|
-
value :DEPLOYED, 1
|
38
|
-
value :UNDEPLOYED, 2
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
module Google::Cloud::AutoML::V1beta1
|
43
|
-
Model = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.Model").msgclass
|
44
|
-
Model::DeploymentState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.Model.DeploymentState").enummodule
|
45
|
-
end
|
@@ -1,90 +0,0 @@
|
|
1
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# source: google/cloud/automl/v1beta1/operations.proto
|
3
|
-
|
4
|
-
|
5
|
-
require 'google/protobuf'
|
6
|
-
|
7
|
-
require 'google/cloud/automl/v1beta1/io_pb'
|
8
|
-
require 'google/cloud/automl/v1beta1/model_pb'
|
9
|
-
require 'google/cloud/automl/v1beta1/model_evaluation_pb'
|
10
|
-
require 'google/protobuf/empty_pb'
|
11
|
-
require 'google/protobuf/timestamp_pb'
|
12
|
-
require 'google/rpc/status_pb'
|
13
|
-
require 'google/api/annotations_pb'
|
14
|
-
Google::Protobuf::DescriptorPool.generated_pool.build do
|
15
|
-
add_message "google.cloud.automl.v1beta1.OperationMetadata" do
|
16
|
-
optional :progress_percent, :int32, 13
|
17
|
-
repeated :partial_failures, :message, 2, "google.rpc.Status"
|
18
|
-
optional :create_time, :message, 3, "google.protobuf.Timestamp"
|
19
|
-
optional :update_time, :message, 4, "google.protobuf.Timestamp"
|
20
|
-
oneof :details do
|
21
|
-
optional :delete_details, :message, 8, "google.cloud.automl.v1beta1.DeleteOperationMetadata"
|
22
|
-
optional :deploy_model_details, :message, 24, "google.cloud.automl.v1beta1.DeployModelOperationMetadata"
|
23
|
-
optional :undeploy_model_details, :message, 25, "google.cloud.automl.v1beta1.UndeployModelOperationMetadata"
|
24
|
-
optional :create_model_details, :message, 10, "google.cloud.automl.v1beta1.CreateModelOperationMetadata"
|
25
|
-
optional :import_data_details, :message, 15, "google.cloud.automl.v1beta1.ImportDataOperationMetadata"
|
26
|
-
optional :batch_predict_details, :message, 16, "google.cloud.automl.v1beta1.BatchPredictOperationMetadata"
|
27
|
-
optional :export_data_details, :message, 21, "google.cloud.automl.v1beta1.ExportDataOperationMetadata"
|
28
|
-
optional :export_model_details, :message, 22, "google.cloud.automl.v1beta1.ExportModelOperationMetadata"
|
29
|
-
optional :export_evaluated_examples_details, :message, 26, "google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
add_message "google.cloud.automl.v1beta1.DeleteOperationMetadata" do
|
33
|
-
end
|
34
|
-
add_message "google.cloud.automl.v1beta1.DeployModelOperationMetadata" do
|
35
|
-
end
|
36
|
-
add_message "google.cloud.automl.v1beta1.UndeployModelOperationMetadata" do
|
37
|
-
end
|
38
|
-
add_message "google.cloud.automl.v1beta1.CreateModelOperationMetadata" do
|
39
|
-
end
|
40
|
-
add_message "google.cloud.automl.v1beta1.ImportDataOperationMetadata" do
|
41
|
-
end
|
42
|
-
add_message "google.cloud.automl.v1beta1.ExportDataOperationMetadata" do
|
43
|
-
optional :output_info, :message, 1, "google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo"
|
44
|
-
end
|
45
|
-
add_message "google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo" do
|
46
|
-
oneof :output_location do
|
47
|
-
optional :gcs_output_directory, :string, 1
|
48
|
-
optional :bigquery_output_dataset, :string, 2
|
49
|
-
end
|
50
|
-
end
|
51
|
-
add_message "google.cloud.automl.v1beta1.BatchPredictOperationMetadata" do
|
52
|
-
optional :input_config, :message, 1, "google.cloud.automl.v1beta1.BatchPredictInputConfig"
|
53
|
-
optional :output_info, :message, 2, "google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo"
|
54
|
-
end
|
55
|
-
add_message "google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo" do
|
56
|
-
oneof :output_location do
|
57
|
-
optional :gcs_output_directory, :string, 1
|
58
|
-
optional :bigquery_output_dataset, :string, 2
|
59
|
-
end
|
60
|
-
end
|
61
|
-
add_message "google.cloud.automl.v1beta1.ExportModelOperationMetadata" do
|
62
|
-
optional :output_info, :message, 2, "google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo"
|
63
|
-
end
|
64
|
-
add_message "google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo" do
|
65
|
-
optional :gcs_output_directory, :string, 1
|
66
|
-
end
|
67
|
-
add_message "google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata" do
|
68
|
-
optional :output_info, :message, 2, "google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo"
|
69
|
-
end
|
70
|
-
add_message "google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo" do
|
71
|
-
optional :bigquery_output_dataset, :string, 2
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
module Google::Cloud::AutoML::V1beta1
|
76
|
-
OperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.OperationMetadata").msgclass
|
77
|
-
DeleteOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.DeleteOperationMetadata").msgclass
|
78
|
-
DeployModelOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.DeployModelOperationMetadata").msgclass
|
79
|
-
UndeployModelOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.UndeployModelOperationMetadata").msgclass
|
80
|
-
CreateModelOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.CreateModelOperationMetadata").msgclass
|
81
|
-
ImportDataOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ImportDataOperationMetadata").msgclass
|
82
|
-
ExportDataOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportDataOperationMetadata").msgclass
|
83
|
-
ExportDataOperationMetadata::ExportDataOutputInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportDataOperationMetadata.ExportDataOutputInfo").msgclass
|
84
|
-
BatchPredictOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BatchPredictOperationMetadata").msgclass
|
85
|
-
BatchPredictOperationMetadata::BatchPredictOutputInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.BatchPredictOperationMetadata.BatchPredictOutputInfo").msgclass
|
86
|
-
ExportModelOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportModelOperationMetadata").msgclass
|
87
|
-
ExportModelOperationMetadata::ExportModelOutputInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportModelOperationMetadata.ExportModelOutputInfo").msgclass
|
88
|
-
ExportEvaluatedExamplesOperationMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata").msgclass
|
89
|
-
ExportEvaluatedExamplesOperationMetadata::ExportEvaluatedExamplesOutputInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.automl.v1beta1.ExportEvaluatedExamplesOperationMetadata.ExportEvaluatedExamplesOutputInfo").msgclass
|
90
|
-
end
|
@@ -1,480 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#
|
15
|
-
# EDITING INSTRUCTIONS
|
16
|
-
# This file was generated from the file
|
17
|
-
# https://github.com/googleapis/googleapis/blob/master/google/cloud/automl/v1beta1/prediction_service.proto,
|
18
|
-
# and updates to that file get reflected here through a refresh process.
|
19
|
-
# For the short term, the refresh process will only be runnable by Google
|
20
|
-
# engineers.
|
21
|
-
|
22
|
-
|
23
|
-
require "json"
|
24
|
-
require "pathname"
|
25
|
-
|
26
|
-
require "google/gax"
|
27
|
-
require "google/gax/operation"
|
28
|
-
require "google/longrunning/operations_client"
|
29
|
-
|
30
|
-
require "google/cloud/automl/v1beta1/prediction_service_pb"
|
31
|
-
require "google/cloud/automl/v1beta1/credentials"
|
32
|
-
require "google/cloud/automl/version"
|
33
|
-
|
34
|
-
module Google
|
35
|
-
module Cloud
|
36
|
-
module AutoML
|
37
|
-
module V1beta1
|
38
|
-
# AutoML Prediction API.
|
39
|
-
#
|
40
|
-
# On any input that is documented to expect a string parameter in
|
41
|
-
# snake_case or kebab-case, either of those cases is accepted.
|
42
|
-
#
|
43
|
-
# @!attribute [r] prediction_service_stub
|
44
|
-
# @return [Google::Cloud::AutoML::V1beta1::PredictionService::Stub]
|
45
|
-
class PredictionServiceClient
|
46
|
-
# @private
|
47
|
-
attr_reader :prediction_service_stub
|
48
|
-
|
49
|
-
# The default address of the service.
|
50
|
-
SERVICE_ADDRESS = "automl.googleapis.com".freeze
|
51
|
-
|
52
|
-
# The default port of the service.
|
53
|
-
DEFAULT_SERVICE_PORT = 443
|
54
|
-
|
55
|
-
# The default set of gRPC interceptors.
|
56
|
-
GRPC_INTERCEPTORS = []
|
57
|
-
|
58
|
-
DEFAULT_TIMEOUT = 30
|
59
|
-
|
60
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
61
|
-
# this service.
|
62
|
-
ALL_SCOPES = [
|
63
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
64
|
-
].freeze
|
65
|
-
|
66
|
-
class OperationsClient < Google::Longrunning::OperationsClient
|
67
|
-
self::SERVICE_ADDRESS = PredictionServiceClient::SERVICE_ADDRESS
|
68
|
-
self::GRPC_INTERCEPTORS = PredictionServiceClient::GRPC_INTERCEPTORS
|
69
|
-
end
|
70
|
-
|
71
|
-
MODEL_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
72
|
-
"projects/{project}/locations/{location}/models/{model}"
|
73
|
-
)
|
74
|
-
|
75
|
-
private_constant :MODEL_PATH_TEMPLATE
|
76
|
-
|
77
|
-
# Returns a fully-qualified model resource name string.
|
78
|
-
# @param project [String]
|
79
|
-
# @param location [String]
|
80
|
-
# @param model [String]
|
81
|
-
# @return [String]
|
82
|
-
def self.model_path project, location, model
|
83
|
-
MODEL_PATH_TEMPLATE.render(
|
84
|
-
:"project" => project,
|
85
|
-
:"location" => location,
|
86
|
-
:"model" => model
|
87
|
-
)
|
88
|
-
end
|
89
|
-
|
90
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
91
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
92
|
-
# be many types.
|
93
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
94
|
-
# authenticating requests made by this client.
|
95
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
96
|
-
# credentials for this client.
|
97
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
98
|
-
# credentials for this client.
|
99
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
100
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
101
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
102
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
103
|
-
# metadata for requests, generally, to give OAuth credentials.
|
104
|
-
# @param scopes [Array<String>]
|
105
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
106
|
-
# an updater_proc is supplied.
|
107
|
-
# @param client_config [Hash]
|
108
|
-
# A Hash for call options for each method. See
|
109
|
-
# Google::Gax#construct_settings for the structure of
|
110
|
-
# this data. Falls back to the default config if not specified
|
111
|
-
# or the specified config is missing data points.
|
112
|
-
# @param timeout [Numeric]
|
113
|
-
# The default timeout, in seconds, for calls made through this client.
|
114
|
-
# @param metadata [Hash]
|
115
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
116
|
-
# @param service_address [String]
|
117
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
118
|
-
# @param service_port [Integer]
|
119
|
-
# Override for the service port, or `nil` to leave as the default.
|
120
|
-
# @param exception_transformer [Proc]
|
121
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
122
|
-
# custom error handling.
|
123
|
-
def initialize \
|
124
|
-
credentials: nil,
|
125
|
-
scopes: ALL_SCOPES,
|
126
|
-
client_config: {},
|
127
|
-
timeout: DEFAULT_TIMEOUT,
|
128
|
-
metadata: nil,
|
129
|
-
service_address: nil,
|
130
|
-
service_port: nil,
|
131
|
-
exception_transformer: nil,
|
132
|
-
lib_name: nil,
|
133
|
-
lib_version: ""
|
134
|
-
# These require statements are intentionally placed here to initialize
|
135
|
-
# the gRPC module only when it's required.
|
136
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
137
|
-
require "google/gax/grpc"
|
138
|
-
require "google/cloud/automl/v1beta1/prediction_service_services_pb"
|
139
|
-
|
140
|
-
credentials ||= Google::Cloud::AutoML::V1beta1::Credentials.default
|
141
|
-
|
142
|
-
@operations_client = OperationsClient.new(
|
143
|
-
credentials: credentials,
|
144
|
-
scopes: scopes,
|
145
|
-
client_config: client_config,
|
146
|
-
timeout: timeout,
|
147
|
-
lib_name: lib_name,
|
148
|
-
service_address: service_address,
|
149
|
-
service_port: service_port,
|
150
|
-
lib_version: lib_version,
|
151
|
-
metadata: metadata,
|
152
|
-
)
|
153
|
-
|
154
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
155
|
-
updater_proc = Google::Cloud::AutoML::V1beta1::Credentials.new(credentials).updater_proc
|
156
|
-
end
|
157
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
158
|
-
channel = credentials
|
159
|
-
end
|
160
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
161
|
-
chan_creds = credentials
|
162
|
-
end
|
163
|
-
if credentials.is_a?(Proc)
|
164
|
-
updater_proc = credentials
|
165
|
-
end
|
166
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
167
|
-
updater_proc = credentials.updater_proc
|
168
|
-
end
|
169
|
-
|
170
|
-
package_version = Google::Cloud::AutoML::VERSION
|
171
|
-
|
172
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
173
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
174
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
175
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
176
|
-
google_api_client.freeze
|
177
|
-
|
178
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
179
|
-
if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
|
180
|
-
headers[:"x-goog-user-project"] = credentials.quota_project_id
|
181
|
-
end
|
182
|
-
headers.merge!(metadata) unless metadata.nil?
|
183
|
-
client_config_file = Pathname.new(__dir__).join(
|
184
|
-
"prediction_service_client_config.json"
|
185
|
-
)
|
186
|
-
defaults = client_config_file.open do |f|
|
187
|
-
Google::Gax.construct_settings(
|
188
|
-
"google.cloud.automl.v1beta1.PredictionService",
|
189
|
-
JSON.parse(f.read),
|
190
|
-
client_config,
|
191
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
192
|
-
timeout,
|
193
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
194
|
-
metadata: headers
|
195
|
-
)
|
196
|
-
end
|
197
|
-
|
198
|
-
# Allow overriding the service path/port in subclasses.
|
199
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
200
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
201
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
202
|
-
@prediction_service_stub = Google::Gax::Grpc.create_stub(
|
203
|
-
service_path,
|
204
|
-
port,
|
205
|
-
chan_creds: chan_creds,
|
206
|
-
channel: channel,
|
207
|
-
updater_proc: updater_proc,
|
208
|
-
scopes: scopes,
|
209
|
-
interceptors: interceptors,
|
210
|
-
&Google::Cloud::AutoML::V1beta1::PredictionService::Stub.method(:new)
|
211
|
-
)
|
212
|
-
|
213
|
-
@predict = Google::Gax.create_api_call(
|
214
|
-
@prediction_service_stub.method(:predict),
|
215
|
-
defaults["predict"],
|
216
|
-
exception_transformer: exception_transformer,
|
217
|
-
params_extractor: proc do |request|
|
218
|
-
{'name' => request.name}
|
219
|
-
end
|
220
|
-
)
|
221
|
-
@batch_predict = Google::Gax.create_api_call(
|
222
|
-
@prediction_service_stub.method(:batch_predict),
|
223
|
-
defaults["batch_predict"],
|
224
|
-
exception_transformer: exception_transformer,
|
225
|
-
params_extractor: proc do |request|
|
226
|
-
{'name' => request.name}
|
227
|
-
end
|
228
|
-
)
|
229
|
-
end
|
230
|
-
|
231
|
-
# Service calls
|
232
|
-
|
233
|
-
# Perform an online prediction. The prediction result will be directly
|
234
|
-
# returned in the response.
|
235
|
-
# Available for following ML problems, and their expected request payloads:
|
236
|
-
# * Image Classification - Image in .JPEG, .GIF or .PNG format, image_bytes
|
237
|
-
# up to 30MB.
|
238
|
-
# * Image Object Detection - Image in .JPEG, .GIF or .PNG format, image_bytes
|
239
|
-
# up to 30MB.
|
240
|
-
# * Text Classification - TextSnippet, content up to 60,000 characters,
|
241
|
-
# UTF-8 encoded.
|
242
|
-
# * Text Extraction - TextSnippet, content up to 30,000 characters,
|
243
|
-
# UTF-8 NFC encoded.
|
244
|
-
# * Translation - TextSnippet, content up to 25,000 characters, UTF-8
|
245
|
-
# encoded.
|
246
|
-
# * Tables - Row, with column values matching the columns of the model,
|
247
|
-
# up to 5MB. Not available for FORECASTING
|
248
|
-
#
|
249
|
-
# {Google::Cloud::AutoML::V1beta1::TablesModelMetadata#prediction_type prediction_type}.
|
250
|
-
# * Text Sentiment - TextSnippet, content up 500 characters, UTF-8
|
251
|
-
# encoded.
|
252
|
-
#
|
253
|
-
# @param name [String]
|
254
|
-
# Required. Name of the model requested to serve the prediction.
|
255
|
-
# @param payload [Google::Cloud::AutoML::V1beta1::ExamplePayload | Hash]
|
256
|
-
# Required. Payload to perform a prediction on. The payload must match the
|
257
|
-
# problem type that the model was trained to solve.
|
258
|
-
# A hash of the same form as `Google::Cloud::AutoML::V1beta1::ExamplePayload`
|
259
|
-
# can also be provided.
|
260
|
-
# @param params [Hash{String => String}]
|
261
|
-
# Additional domain-specific parameters, any string must be up to 25000
|
262
|
-
# characters long.
|
263
|
-
#
|
264
|
-
# * For Image Classification:
|
265
|
-
#
|
266
|
-
# `score_threshold` - (float) A value from 0.0 to 1.0. When the model
|
267
|
-
# makes predictions for an image, it will only produce results that have
|
268
|
-
# at least this confidence score. The default is 0.5.
|
269
|
-
#
|
270
|
-
# * For Image Object Detection:
|
271
|
-
# `score_threshold` - (float) When Model detects objects on the image,
|
272
|
-
# it will only produce bounding boxes which have at least this
|
273
|
-
# confidence score. Value in 0 to 1 range, default is 0.5.
|
274
|
-
# `max_bounding_box_count` - (int64) No more than this number of bounding
|
275
|
-
# boxes will be returned in the response. Default is 100, the
|
276
|
-
# requested value may be limited by server.
|
277
|
-
# * For Tables:
|
278
|
-
# feature_imp<span>ortan</span>ce - (boolean) Whether feature importance
|
279
|
-
# should be populated in the returned TablesAnnotation.
|
280
|
-
# The default is false.
|
281
|
-
# @param options [Google::Gax::CallOptions]
|
282
|
-
# Overrides the default settings for this call, e.g, timeout,
|
283
|
-
# retries, etc.
|
284
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
285
|
-
# @yieldparam result [Google::Cloud::AutoML::V1beta1::PredictResponse]
|
286
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
287
|
-
# @return [Google::Cloud::AutoML::V1beta1::PredictResponse]
|
288
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
289
|
-
# @example
|
290
|
-
# require "google/cloud/automl"
|
291
|
-
#
|
292
|
-
# prediction_client = Google::Cloud::AutoML::Prediction.new(version: :v1beta1)
|
293
|
-
# formatted_name = Google::Cloud::AutoML::V1beta1::PredictionServiceClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
|
294
|
-
#
|
295
|
-
# # TODO: Initialize `payload`:
|
296
|
-
# payload = {}
|
297
|
-
# response = prediction_client.predict(formatted_name, payload)
|
298
|
-
|
299
|
-
def predict \
|
300
|
-
name,
|
301
|
-
payload,
|
302
|
-
params: nil,
|
303
|
-
options: nil,
|
304
|
-
&block
|
305
|
-
req = {
|
306
|
-
name: name,
|
307
|
-
payload: payload,
|
308
|
-
params: params
|
309
|
-
}.delete_if { |_, v| v.nil? }
|
310
|
-
req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::PredictRequest)
|
311
|
-
@predict.call(req, options, &block)
|
312
|
-
end
|
313
|
-
|
314
|
-
# Perform a batch prediction. Unlike the online {Google::Cloud::AutoML::V1beta1::PredictionService::Predict Predict}, batch
|
315
|
-
# prediction result won't be immediately available in the response. Instead,
|
316
|
-
# a long running operation object is returned. User can poll the operation
|
317
|
-
# result via {Google::Longrunning::Operations::GetOperation GetOperation}
|
318
|
-
# method. Once the operation is done, {Google::Cloud::AutoML::V1beta1::BatchPredictResult BatchPredictResult} is returned in
|
319
|
-
# the {Google::Longrunning::Operation#response response} field.
|
320
|
-
# Available for following ML problems:
|
321
|
-
# * Image Classification
|
322
|
-
# * Image Object Detection
|
323
|
-
# * Video Classification
|
324
|
-
# * Video Object Tracking * Text Extraction
|
325
|
-
# * Tables
|
326
|
-
#
|
327
|
-
# @param name [String]
|
328
|
-
# Required. Name of the model requested to serve the batch prediction.
|
329
|
-
# @param input_config [Google::Cloud::AutoML::V1beta1::BatchPredictInputConfig | Hash]
|
330
|
-
# Required. The input configuration for batch prediction.
|
331
|
-
# A hash of the same form as `Google::Cloud::AutoML::V1beta1::BatchPredictInputConfig`
|
332
|
-
# can also be provided.
|
333
|
-
# @param output_config [Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig | Hash]
|
334
|
-
# Required. The Configuration specifying where output predictions should
|
335
|
-
# be written.
|
336
|
-
# A hash of the same form as `Google::Cloud::AutoML::V1beta1::BatchPredictOutputConfig`
|
337
|
-
# can also be provided.
|
338
|
-
# @param params [Hash{String => String}]
|
339
|
-
# Required. Additional domain-specific parameters for the predictions, any string must
|
340
|
-
# be up to 25000 characters long.
|
341
|
-
#
|
342
|
-
# * For Text Classification:
|
343
|
-
#
|
344
|
-
# `score_threshold` - (float) A value from 0.0 to 1.0. When the model
|
345
|
-
# makes predictions for a text snippet, it will only produce results
|
346
|
-
# that have at least this confidence score. The default is 0.5.
|
347
|
-
#
|
348
|
-
# * For Image Classification:
|
349
|
-
#
|
350
|
-
# `score_threshold` - (float) A value from 0.0 to 1.0. When the model
|
351
|
-
# makes predictions for an image, it will only produce results that
|
352
|
-
# have at least this confidence score. The default is 0.5.
|
353
|
-
#
|
354
|
-
# * For Image Object Detection:
|
355
|
-
#
|
356
|
-
# `score_threshold` - (float) When Model detects objects on the image,
|
357
|
-
# it will only produce bounding boxes which have at least this
|
358
|
-
# confidence score. Value in 0 to 1 range, default is 0.5.
|
359
|
-
# `max_bounding_box_count` - (int64) No more than this number of bounding
|
360
|
-
# boxes will be produced per image. Default is 100, the
|
361
|
-
# requested value may be limited by server.
|
362
|
-
#
|
363
|
-
# * For Video Classification :
|
364
|
-
#
|
365
|
-
# `score_threshold` - (float) A value from 0.0 to 1.0. When the model
|
366
|
-
# makes predictions for a video, it will only produce results that
|
367
|
-
# have at least this confidence score. The default is 0.5.
|
368
|
-
# `segment_classification` - (boolean) Set to true to request
|
369
|
-
# segment-level classification. AutoML Video Intelligence returns
|
370
|
-
# labels and their confidence scores for the entire segment of the
|
371
|
-
# video that user specified in the request configuration.
|
372
|
-
# The default is "true".
|
373
|
-
# `shot_classification` - (boolean) Set to true to request shot-level
|
374
|
-
# classification. AutoML Video Intelligence determines the boundaries
|
375
|
-
# for each camera shot in the entire segment of the video that user
|
376
|
-
# specified in the request configuration. AutoML Video Intelligence
|
377
|
-
# then returns labels and their confidence scores for each detected
|
378
|
-
# shot, along with the start and end time of the shot.
|
379
|
-
# WARNING: Model evaluation is not done for this classification type,
|
380
|
-
# the quality of it depends on training data, but there are no metrics
|
381
|
-
# provided to describe that quality. The default is "false".
|
382
|
-
# `1s_interval_classification` - (boolean) Set to true to request
|
383
|
-
# classification for a video at one-second intervals. AutoML Video
|
384
|
-
# Intelligence returns labels and their confidence scores for each
|
385
|
-
# second of the entire segment of the video that user specified in the
|
386
|
-
# request configuration.
|
387
|
-
# WARNING: Model evaluation is not done for this classification
|
388
|
-
# type, the quality of it depends on training data, but there are no
|
389
|
-
# metrics provided to describe that quality. The default is
|
390
|
-
# "false".
|
391
|
-
#
|
392
|
-
# * For Tables:
|
393
|
-
#
|
394
|
-
# feature_imp<span>ortan</span>ce - (boolean) Whether feature importance
|
395
|
-
# should be populated in the returned TablesAnnotations. The
|
396
|
-
# default is false.
|
397
|
-
#
|
398
|
-
# * For Video Object Tracking:
|
399
|
-
#
|
400
|
-
# `score_threshold` - (float) When Model detects objects on video frames,
|
401
|
-
# it will only produce bounding boxes which have at least this
|
402
|
-
# confidence score. Value in 0 to 1 range, default is 0.5.
|
403
|
-
# `max_bounding_box_count` - (int64) No more than this number of bounding
|
404
|
-
# boxes will be returned per frame. Default is 100, the requested
|
405
|
-
# value may be limited by server.
|
406
|
-
# `min_bounding_box_size` - (float) Only bounding boxes with shortest edge
|
407
|
-
# at least that long as a relative value of video frame size will be
|
408
|
-
# returned. Value in 0 to 1 range. Default is 0.
|
409
|
-
# @param options [Google::Gax::CallOptions]
|
410
|
-
# Overrides the default settings for this call, e.g, timeout,
|
411
|
-
# retries, etc.
|
412
|
-
# @return [Google::Gax::Operation]
|
413
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
414
|
-
# @example
|
415
|
-
# require "google/cloud/automl"
|
416
|
-
#
|
417
|
-
# prediction_client = Google::Cloud::AutoML::Prediction.new(version: :v1beta1)
|
418
|
-
# formatted_name = Google::Cloud::AutoML::V1beta1::PredictionServiceClient.model_path("[PROJECT]", "[LOCATION]", "[MODEL]")
|
419
|
-
#
|
420
|
-
# # TODO: Initialize `input_config`:
|
421
|
-
# input_config = {}
|
422
|
-
#
|
423
|
-
# # TODO: Initialize `output_config`:
|
424
|
-
# output_config = {}
|
425
|
-
#
|
426
|
-
# # Register a callback during the method call.
|
427
|
-
# operation = prediction_client.batch_predict(formatted_name, input_config, output_config) do |op|
|
428
|
-
# raise op.results.message if op.error?
|
429
|
-
# op_results = op.results
|
430
|
-
# # Process the results.
|
431
|
-
#
|
432
|
-
# metadata = op.metadata
|
433
|
-
# # Process the metadata.
|
434
|
-
# end
|
435
|
-
#
|
436
|
-
# # Or use the return value to register a callback.
|
437
|
-
# operation.on_done do |op|
|
438
|
-
# raise op.results.message if op.error?
|
439
|
-
# op_results = op.results
|
440
|
-
# # Process the results.
|
441
|
-
#
|
442
|
-
# metadata = op.metadata
|
443
|
-
# # Process the metadata.
|
444
|
-
# end
|
445
|
-
#
|
446
|
-
# # Manually reload the operation.
|
447
|
-
# operation.reload!
|
448
|
-
#
|
449
|
-
# # Or block until the operation completes, triggering callbacks on
|
450
|
-
# # completion.
|
451
|
-
# operation.wait_until_done!
|
452
|
-
|
453
|
-
def batch_predict \
|
454
|
-
name,
|
455
|
-
input_config,
|
456
|
-
output_config,
|
457
|
-
params: nil,
|
458
|
-
options: nil
|
459
|
-
req = {
|
460
|
-
name: name,
|
461
|
-
input_config: input_config,
|
462
|
-
output_config: output_config,
|
463
|
-
params: params
|
464
|
-
}.delete_if { |_, v| v.nil? }
|
465
|
-
req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::BatchPredictRequest)
|
466
|
-
operation = Google::Gax::Operation.new(
|
467
|
-
@batch_predict.call(req, options),
|
468
|
-
@operations_client,
|
469
|
-
Google::Cloud::AutoML::V1beta1::BatchPredictResult,
|
470
|
-
Google::Cloud::AutoML::V1beta1::OperationMetadata,
|
471
|
-
call_options: options
|
472
|
-
)
|
473
|
-
operation.on_done { |operation| yield(operation) } if block_given?
|
474
|
-
operation
|
475
|
-
end
|
476
|
-
end
|
477
|
-
end
|
478
|
-
end
|
479
|
-
end
|
480
|
-
end
|