@@ -19,6 +19,7 @@ package google.cloud.vision.v1;
19
19
20
20
import "google/api/annotations.proto" ;
21
21
import "google/api/client.proto" ;
22
+ import "google/api/field_behavior.proto" ;
22
23
import "google/cloud/vision/v1/geometry.proto" ;
23
24
import "google/cloud/vision/v1/product_search.proto" ;
24
25
import "google/cloud/vision/v1/text_annotation.proto" ;
@@ -47,8 +48,7 @@ service ImageAnnotator {
47
48
"https://www.googleapis.com/auth/cloud-vision" ;
48
49
49
50
// Run image detection and annotation for a batch of images.
50
- rpc BatchAnnotateImages (BatchAnnotateImagesRequest )
51
- returns (BatchAnnotateImagesResponse ) {
51
+ rpc BatchAnnotateImages (BatchAnnotateImagesRequest ) returns (BatchAnnotateImagesResponse ) {
52
52
option (google.api.http ) = {
53
53
post : "/v1/images:annotate"
54
54
body : "*"
@@ -61,6 +61,7 @@ service ImageAnnotator {
61
61
body : "*"
62
62
}
63
63
};
64
+ option (google.api.method_signature ) = "requests" ;
64
65
}
65
66
66
67
// Service that performs image detection and annotation for a batch of files.
@@ -70,8 +71,7 @@ service ImageAnnotator {
70
71
// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each
71
72
// file provided and perform detection and annotation for each image
72
73
// extracted.
73
- rpc BatchAnnotateFiles (BatchAnnotateFilesRequest )
74
- returns (BatchAnnotateFilesResponse ) {
74
+ rpc BatchAnnotateFiles (BatchAnnotateFilesRequest ) returns (BatchAnnotateFilesResponse ) {
75
75
option (google.api.http ) = {
76
76
post : "/v1/files:annotate"
77
77
body : "*"
@@ -84,6 +84,7 @@ service ImageAnnotator {
84
84
body : "*"
85
85
}
86
86
};
87
+ option (google.api.method_signature ) = "requests" ;
87
88
}
88
89
89
90
// Run asynchronous image detection and annotation for a list of images.
@@ -95,8 +96,7 @@ service ImageAnnotator {
95
96
//
96
97
// This service will write image annotation outputs to json files in customer
97
98
// GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
98
- rpc AsyncBatchAnnotateImages (AsyncBatchAnnotateImagesRequest )
99
- returns (google .longrunning .Operation ) {
99
+ rpc AsyncBatchAnnotateImages (AsyncBatchAnnotateImagesRequest ) returns (google .longrunning .Operation ) {
100
100
option (google.api.http ) = {
101
101
post : "/v1/images:asyncBatchAnnotate"
102
102
body : "*"
@@ -109,6 +109,11 @@ service ImageAnnotator {
109
109
body : "*"
110
110
}
111
111
};
112
+ option (google.api.method_signature ) = "requests,output_config" ;
113
+ option (google.longrunning.operation_info ) = {
114
+ response_type : "AsyncBatchAnnotateImagesResponse"
115
+ metadata_type : "OperationMetadata"
116
+ };
112
117
}
113
118
114
119
// Run asynchronous image detection and annotation for a list of generic
@@ -117,8 +122,7 @@ service ImageAnnotator {
117
122
// `google.longrunning.Operations` interface.
118
123
// `Operation.metadata` contains `OperationMetadata` (metadata).
119
124
// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
120
- rpc AsyncBatchAnnotateFiles (AsyncBatchAnnotateFilesRequest )
121
- returns (google .longrunning .Operation ) {
125
+ rpc AsyncBatchAnnotateFiles (AsyncBatchAnnotateFilesRequest ) returns (google .longrunning .Operation ) {
122
126
option (google.api.http ) = {
123
127
post : "/v1/files:asyncBatchAnnotate"
124
128
body : "*"
@@ -131,6 +135,11 @@ service ImageAnnotator {
131
135
body : "*"
132
136
}
133
137
};
138
+ option (google.api.method_signature ) = "requests" ;
139
+ option (google.longrunning.operation_info ) = {
140
+ response_type : "AsyncBatchAnnotateFilesResponse"
141
+ metadata_type : "OperationMetadata"
142
+ };
134
143
}
135
144
}
136
145
@@ -557,6 +566,30 @@ message SafeSearchAnnotation {
557
566
// covered nudity, lewd or provocative poses, or close-ups of sensitive
558
567
// body areas.
559
568
Likelihood racy = 9 ;
569
+
570
+ // Confidence of adult_score. Range [0, 1]. 0 means not confident, 1 means
571
+ // very confident.
572
+ float adult_confidence = 16 ;
573
+
574
+ // Confidence of spoof_score. Range [0, 1]. 0 means not confident, 1 means
575
+ // very confident.
576
+ float spoof_confidence = 18 ;
577
+
578
+ // Confidence of medical_score. Range [0, 1]. 0 means not confident, 1 means
579
+ // very confident.
580
+ float medical_confidence = 20 ;
581
+
582
+ // Confidence of violence_score. Range [0, 1]. 0 means not confident, 1 means
583
+ // very confident.
584
+ float violence_confidence = 22 ;
585
+
586
+ // Confidence of racy_score. Range [0, 1]. 0 means not confident, 1 means very
587
+ // confident.
588
+ float racy_confidence = 24 ;
589
+
590
+ // Confidence of nsfw_score. Range [0, 1]. 0 means not confident, 1 means very
591
+ // confident.
592
+ float nsfw_confidence = 26 ;
560
593
}
561
594
562
595
// Rectangle determined by min and max `LatLng` pairs.
@@ -732,28 +765,10 @@ message AnnotateImageResponse {
732
765
ImageAnnotationContext context = 21 ;
733
766
}
734
767
735
- // Response to a single file annotation request. A file may contain one or more
736
- // images, which individually have their own responses.
737
- message AnnotateFileResponse {
738
- // Information about the file for which this response is generated.
739
- InputConfig input_config = 1 ;
740
-
741
- // Individual responses to images found within the file. This field will be
742
- // empty if the `error` field is set.
743
- repeated AnnotateImageResponse responses = 2 ;
744
-
745
- // This field gives the total number of pages in the file.
746
- int32 total_pages = 3 ;
747
-
748
- // If set, represents the error message for the failed request. The
749
- // `responses` field will not be set in this case.
750
- google.rpc.Status error = 4 ;
751
- }
752
-
753
768
// Multiple image annotation requests are batched into a single service call.
754
769
message BatchAnnotateImagesRequest {
755
- // Individual image annotation requests for this batch.
756
- repeated AnnotateImageRequest requests = 1 ;
770
+ // Required. Individual image annotation requests for this batch.
771
+ repeated AnnotateImageRequest requests = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
757
772
758
773
// Optional. Target project and location to make a call.
759
774
//
@@ -804,11 +819,29 @@ message AnnotateFileRequest {
804
819
repeated int32 pages = 4 ;
805
820
}
806
821
822
+ // Response to a single file annotation request. A file may contain one or more
823
+ // images, which individually have their own responses.
824
+ message AnnotateFileResponse {
825
+ // Information about the file for which this response is generated.
826
+ InputConfig input_config = 1 ;
827
+
828
+ // Individual responses to images found within the file. This field will be
829
+ // empty if the `error` field is set.
830
+ repeated AnnotateImageResponse responses = 2 ;
831
+
832
+ // This field gives the total number of pages in the file.
833
+ int32 total_pages = 3 ;
834
+
835
+ // If set, represents the error message for the failed request. The
836
+ // `responses` field will not be set in this case.
837
+ google.rpc.Status error = 4 ;
838
+ }
839
+
807
840
// A list of requests to annotate files using the BatchAnnotateFiles API.
808
841
message BatchAnnotateFilesRequest {
809
- // The list of file annotation requests. Right now we support only one
842
+ // Required. The list of file annotation requests. Right now we support only one
810
843
// AnnotateFileRequest in BatchAnnotateFilesRequest.
811
- repeated AnnotateFileRequest requests = 1 ;
844
+ repeated AnnotateFileRequest requests = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
812
845
813
846
// Optional. Target project and location to make a call.
814
847
//
@@ -855,11 +888,11 @@ message AsyncAnnotateFileResponse {
855
888
856
889
// Request for async image annotation for a list of images.
857
890
message AsyncBatchAnnotateImagesRequest {
858
- // Individual image annotation requests for this batch.
859
- repeated AnnotateImageRequest requests = 1 ;
891
+ // Required. Individual image annotation requests for this batch.
892
+ repeated AnnotateImageRequest requests = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
860
893
861
894
// Required. The desired output location and metadata (e.g. format).
862
- OutputConfig output_config = 2 ;
895
+ OutputConfig output_config = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
863
896
864
897
// Optional. Target project and location to make a call.
865
898
//
@@ -885,8 +918,8 @@ message AsyncBatchAnnotateImagesResponse {
885
918
// Multiple async file annotation requests are batched into a single service
886
919
// call.
887
920
message AsyncBatchAnnotateFilesRequest {
888
- // Individual async file annotation requests for this batch.
889
- repeated AsyncAnnotateFileRequest requests = 1 ;
921
+ // Required. Individual async file annotation requests for this batch.
922
+ repeated AsyncAnnotateFileRequest requests = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
890
923
891
924
// Optional. Target project and location to make a call.
892
925
//
0 commit comments