1 // Copyright 2018 Google LLC.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 package google.cloud.vision.v1p4beta1;
20 import "google/api/annotations.proto";
21 import "google/cloud/vision/v1p4beta1/geometry.proto";
22 import "google/cloud/vision/v1p4beta1/product_search_service.proto";
23 import "google/protobuf/timestamp.proto";
25 option cc_enable_arenas = true;
26 option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision";
27 option java_multiple_files = true;
28 option java_outer_classname = "ProductSearchProto";
29 option java_package = "com.google.cloud.vision.v1p4beta1";
30 option objc_class_prefix = "GCVN";
32 // Parameters for a product search request.
33 message ProductSearchParams {
34 // The bounding polygon around the area of interest in the image.
35 // Optional. If it is not specified, system discretion will be applied.
36 BoundingPoly bounding_poly = 9;
38 // The resource name of a
39 // [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] to be searched for
43 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
44 string product_set = 6;
46 // The list of product categories to search in. Currently, we only consider
47 // the first category, and either "homegoods", "apparel", or "toys" should be
49 repeated string product_categories = 7;
51 // The filtering expression. This can be used to restrict search results based
52 // on Product labels. We currently support an AND of OR of key-value
53 // expressions, where each expression within an OR must have the same key.
55 // For example, "(color = red OR color = blue) AND brand = Google" is
56 // acceptable, but not "(color = red OR brand = Google)" or "color: red".
60 // Results for a product search request.
61 message ProductSearchResults {
62 // Information about a product.
67 // A confidence level on the match, ranging from 0 (no confidence) to
68 // 1 (full confidence).
71 // The resource name of the image from the product that is the closest match
76 // Information about the products similar to a single product in a query
78 message GroupedResult {
79 // The bounding polygon around the product detected in the query image.
80 BoundingPoly bounding_poly = 1;
82 // List of results, one for each product match.
83 repeated Result results = 2;
86 // Timestamp of the index which provided these results. Changes made after
87 // this time are not reflected in the current results.
88 google.protobuf.Timestamp index_time = 2;
90 // List of results, one for each product match.
91 repeated Result results = 5;
93 // List of results grouped by products detected in the query image. Each entry
94 // corresponds to one bounding polygon in the query image, and contains the
95 // matching products specific to that region. There may be duplicate product
96 // matches in the union of all the per-product results.
97 repeated GroupedResult product_grouped_results = 6;