Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions protos/google/cloud/vision/v1p4beta1/face.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.cloud.vision.v1p4beta1;

import "google/api/annotations.proto";
import "google/cloud/vision/v1p4beta1/geometry.proto";

option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision";
option java_multiple_files = true;
option java_outer_classname = "CelebrityProto";
option java_package = "com.google.cloud.vision.v1p4beta1";
option objc_class_prefix = "GCVN";

// Parameters for a celebrity recognition request.
message FaceRecognitionParams {
// The resource names for one or more
// [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. A celebrity
// set is preloaded and can be specified as "builtin/default". If this is
// specified, the algorithm will try to match the faces detected in the input
// image to the Celebrities in the CelebritySets.
repeated string celebrity_set = 1;
}

// A Celebrity is a group of Faces with an identity.
message Celebrity {
// The resource name of the preloaded Celebrity. Has the format
// `builtin/{mid}`.
string name = 1;

// The Celebrity's display name.
string display_name = 2;

// The Celebrity's description.
string description = 3;
}

// Information about a face's identity.
message FaceRecognitionResult {
// The [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] that this face was
// matched to.
Celebrity celebrity = 1;

// Recognition confidence. Range [0, 1].
float confidence = 2;
}
2 changes: 1 addition & 1 deletion protos/google/cloud/vision/v1p4beta1/geometry.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
117 changes: 81 additions & 36 deletions protos/google/cloud/vision/v1p4beta1/image_annotator.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,9 @@ syntax = "proto3";
package google.cloud.vision.v1p4beta1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/cloud/vision/v1p4beta1/face.proto";
import "google/cloud/vision/v1p4beta1/geometry.proto";
import "google/cloud/vision/v1p4beta1/product_search.proto";
import "google/cloud/vision/v1p4beta1/text_annotation.proto";
Expand All @@ -40,13 +43,19 @@ option objc_class_prefix = "GCVN";
// images, such as face, landmark, logo, label, and text detection. The
// ImageAnnotator service returns detected entities from the images.
service ImageAnnotator {
option (google.api.default_host) = "vision.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/cloud-vision";

// Run image detection and annotation for a batch of images.
rpc BatchAnnotateImages(BatchAnnotateImagesRequest)
returns (BatchAnnotateImagesResponse) {
option (google.api.http) = {
post: "/v1p4beta1/images:annotate"
body: "*"
};
option (google.api.method_signature) = "requests";
}

// Service that performs image detection and annotation for a batch of files.
Expand All @@ -62,6 +71,7 @@ service ImageAnnotator {
post: "/v1p4beta1/files:annotate"
body: "*"
};
option (google.api.method_signature) = "requests";
}

// Run asynchronous image detection and annotation for a list of images.
Expand All @@ -79,6 +89,11 @@ service ImageAnnotator {
post: "/v1p4beta1/images:asyncBatchAnnotate"
body: "*"
};
option (google.api.method_signature) = "requests,output_config";
option (google.longrunning.operation_info) = {
response_type: "AsyncBatchAnnotateImagesResponse"
metadata_type: "OperationMetadata"
};
}

// Run asynchronous image detection and annotation for a list of generic
Expand All @@ -93,6 +108,11 @@ service ImageAnnotator {
post: "/v1p4beta1/files:asyncBatchAnnotate"
body: "*"
};
option (google.api.method_signature) = "requests";
option (google.longrunning.operation_info) = {
response_type: "AsyncBatchAnnotateFilesResponse"
metadata_type: "OperationMetadata"
};
}
}

Expand Down Expand Up @@ -209,19 +229,19 @@ enum Likelihood {
// Unknown likelihood.
UNKNOWN = 0;

// It is very unlikely that the image belongs to the specified vertical.
// It is very unlikely.
VERY_UNLIKELY = 1;

// It is unlikely that the image belongs to the specified vertical.
// It is unlikely.
UNLIKELY = 2;

// It is possible that the image belongs to the specified vertical.
// It is possible.
POSSIBLE = 3;

// It is likely that the image belongs to the specified vertical.
// It is likely.
LIKELY = 4;

// It is very likely that the image belongs to the specified vertical.
// It is very likely.
VERY_LIKELY = 5;
}

Expand Down Expand Up @@ -407,6 +427,13 @@ message FaceAnnotation {

// Headwear likelihood.
Likelihood headwear_likelihood = 15;

// Additional recognition information. Only computed if
// image_context.face_recognition_params is provided, **and** a match is found
// to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input
// [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is
// sorted in order of decreasing confidence values.
repeated FaceRecognitionResult recognition_result = 16;
}

// Detected entity location information.
Expand Down Expand Up @@ -611,6 +638,9 @@ message ImageContext {
// Parameters for crop hints annotation request.
CropHintsParams crop_hints_params = 4;

// Parameters for face recognition.
FaceRecognitionParams face_recognition_params = 10;

// Parameters for product search.
ProductSearchParams product_search_params = 5;

Expand Down Expand Up @@ -694,19 +724,6 @@ message AnnotateImageResponse {
ImageAnnotationContext context = 21;
}

// Response to a single file annotation request. A file may contain one or more
// images, which individually have their own responses.
message AnnotateFileResponse {
// Information about the file for which this response is generated.
InputConfig input_config = 1;

// Individual responses to images found within the file.
repeated AnnotateImageResponse responses = 2;

// This field gives the total number of pages in the file.
int32 total_pages = 3;
}

// Multiple image annotation requests are batched into a single service call.
message BatchAnnotateImagesRequest {
// Individual image annotation requests for this batch.
Expand Down Expand Up @@ -747,11 +764,30 @@ message AnnotateFileRequest {
repeated int32 pages = 4;
}

// Response to a single file annotation request. A file may contain one or more
// images, which individually have their own responses.
message AnnotateFileResponse {
// Information about the file for which this response is generated.
InputConfig input_config = 1;

// Individual responses to images found within the file. This field will be
// empty if the `error` field is set.
repeated AnnotateImageResponse responses = 2;

// This field gives the total number of pages in the file.
int32 total_pages = 3;

// If set, represents the error message for the failed request. The
// `responses` field will not be set in this case.
google.rpc.Status error = 4;
}

// A list of requests to annotate files using the BatchAnnotateFiles API.
message BatchAnnotateFilesRequest {
// The list of file annotation requests. Right now we support only one
// AnnotateFileRequest in BatchAnnotateFilesRequest.
repeated AnnotateFileRequest requests = 1;
// Required. The list of file annotation requests. Right now we support only
// one AnnotateFileRequest in BatchAnnotateFilesRequest.
repeated AnnotateFileRequest requests = 1
[(google.api.field_behavior) = REQUIRED];
}

// A list of file annotation responses.
Expand Down Expand Up @@ -784,11 +820,12 @@ message AsyncAnnotateFileResponse {

// Request for async image annotation for a list of images.
message AsyncBatchAnnotateImagesRequest {
// Individual image annotation requests for this batch.
repeated AnnotateImageRequest requests = 1;
// Required. Individual image annotation requests for this batch.
repeated AnnotateImageRequest requests = 1
[(google.api.field_behavior) = REQUIRED];

// Required. The desired output location and metadata (e.g. format).
OutputConfig output_config = 2;
OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
}

// Response to an async batch image annotation request.
Expand All @@ -800,8 +837,9 @@ message AsyncBatchAnnotateImagesResponse {
// Multiple async file annotation requests are batched into a single service
// call.
message AsyncBatchAnnotateFilesRequest {
// Individual async file annotation requests for this batch.
repeated AsyncAnnotateFileRequest requests = 1;
// Required. Individual async file annotation requests for this batch.
repeated AsyncAnnotateFileRequest requests = 1
[(google.api.field_behavior) = REQUIRED];
}

// Response to an async batch file annotation request.
Expand All @@ -824,8 +862,8 @@ message InputConfig {
// not work for AsyncBatchAnnotateFiles requests.
bytes content = 3;

// The type of the file. Currently only "application/pdf" and "image/tiff"
// are supported. Wildcards are not supported.
// The type of the file. Currently only "application/pdf", "image/tiff" and
// "image/gif" are supported. Wildcards are not supported.
string mime_type = 2;
}

Expand Down Expand Up @@ -857,16 +895,23 @@ message GcsSource {

// The Google Cloud Storage location where the output will be written to.
message GcsDestination {
// Google Cloud Storage URI where the results will be stored. Results will
// be in JSON format and preceded by its corresponding input URI. This field
// can either represent a single file, or a prefix for multiple outputs.
// Prefixes must end in a `/`.
// Google Cloud Storage URI prefix where the results will be stored. Results
// will be in JSON format and preceded by its corresponding input URI prefix.
// This field can either represent a gcs file prefix or gcs directory. In
// either case, the uri should be unique because in order to get all of the
// output files, you will need to do a wildcard gcs search on the uri prefix
// you provide.
//
// Examples:
//
// * File: gs://bucket-name/filename.json
// * Prefix: gs://bucket-name/prefix/here/
// * File: gs://bucket-name/prefix/here
// * File Prefix: gs://bucket-name/here/filenameprefix The output files
// will be created in gs://bucket-name/here/ and the names of the
// output files will begin with "filenameprefix".
//
// * Directory Prefix: gs://bucket-name/some/location/ The output files
// will be created in gs://bucket-name/some/location/ and the names of the
// output files could be anything because there was no filename prefix
// specified.
//
// If multiple outputs, each response is still AnnotateFileResponse, each of
// which contains some subset of the full list of AnnotateImageResponse.
Expand Down
40 changes: 33 additions & 7 deletions protos/google/cloud/vision/v1p4beta1/product_search.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@ syntax = "proto3";
package google.cloud.vision.v1p4beta1;

import "google/api/annotations.proto";
import "google/api/resource.proto";
import "google/cloud/vision/v1p4beta1/geometry.proto";
import "google/cloud/vision/v1p4beta1/product_search_service.proto";
import "google/protobuf/timestamp.proto";
Expand All @@ -32,7 +33,7 @@ option objc_class_prefix = "GCVN";
// Parameters for a product search request.
message ProductSearchParams {
// The bounding polygon around the area of interest in the image.
// Optional. If it is not specified, system discretion will be applied.
// If it is not specified, system discretion will be applied.
BoundingPoly bounding_poly = 9;

// The resource name of a
Expand All @@ -41,7 +42,9 @@ message ProductSearchParams {
//
// Format is:
// `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
string product_set = 6;
string product_set = 6 [(google.api.resource_reference) = {
type: "vision.googleapis.com/ProductSet"
}];

// The list of product categories to search in. Currently, we only consider
// the first category, and either "homegoods-v2", "apparel-v2", "toys-v2",
Expand All @@ -54,10 +57,12 @@ message ProductSearchParams {

// The filtering expression. This can be used to restrict search results based
// on Product labels. We currently support an AND of OR of key-value
// expressions, where each expression within an OR must have the same key.
// expressions, where each expression within an OR must have the same key. An
// '=' should be used to connect the key and value.
//
// For example, "(color = red OR color = blue) AND brand = Google" is
// acceptable, but not "(color = red OR brand = Google)" or "color: red".
// acceptable, but "(color = red OR brand = Google)" is not acceptable.
// "color: red" is not acceptable because it uses a ':' instead of an '='.
string filter = 8;
}

Expand All @@ -77,6 +82,23 @@ message ProductSearchResults {
string image = 3;
}

// Prediction for what the object in the bounding box is.
message ObjectAnnotation {
// Object ID that should align with EntityAnnotation mid.
string mid = 1;

// The BCP-47 language code, such as "en-US" or "sr-Latn". For more
// information, see
// http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
string language_code = 2;

// Object name, expressed in its `language_code` language.
string name = 3;

// Score of the result. Range [0, 1].
float score = 4;
}

// Information about the products similar to a single product in a query
// image.
message GroupedResult {
Expand All @@ -85,10 +107,14 @@ message ProductSearchResults {

// List of results, one for each product match.
repeated Result results = 2;

// List of generic predictions for the object in the bounding box.
repeated ObjectAnnotation object_annotations = 3;
}

// Timestamp of the index which provided these results. Changes made after
// this time are not reflected in the current results.
// Timestamp of the index which provided these results. Products added to the
// product set and products removed from the product set after this time are
// not reflected in the current results.
google.protobuf.Timestamp index_time = 2;

// List of results, one for each product match.
Expand Down
Loading