1- // Copyright 2019 Google LLC.
1+ // Copyright 2022 Google LLC
22//
33// Licensed under the Apache License, Version 2.0 (the "License");
44// you may not use this file except in compliance with the License.
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
14- //
1514
1615syntax = "proto3" ;
1716
1817package google.cloud.vision.v1p3beta1 ;
1918
20- import "google/api/annotations.proto" ;
2119import "google/api/resource.proto" ;
2220import "google/cloud/vision/v1p3beta1/geometry.proto" ;
2321import "google/cloud/vision/v1p3beta1/product_search_service.proto" ;
@@ -28,41 +26,15 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta
2826option java_multiple_files = true ;
2927option java_outer_classname = "ProductSearchProto" ;
3028option java_package = "com.google.cloud.vision.v1p3beta1" ;
29+ option objc_class_prefix = "GCVN" ;
3130
3231// Parameters for a product search request.
3332message ProductSearchParams {
34- // The resource name of the catalog to search.
35- //
36- // Format is: `productSearch/catalogs/CATALOG_NAME`.
37- string catalog_name = 1 ;
38-
39- // The category to search in.
40- // Optional. It is inferred by the system if it is not specified.
41- // [Deprecated] Use `product_category`.
42- ProductSearchCategory category = 2 ;
43-
44- // The product category to search in.
45- // Optional. It is inferred by the system if it is not specified.
46- // Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`,
47- // `skirt`, `top`, `shorts`, and `pants`.
48- string product_category = 5 ;
49-
50- // The bounding polygon around the area of interest in the image.
51- // Optional. If it is not specified, system discretion will be applied.
52- // [Deprecated] Use `bounding_poly`.
53- NormalizedBoundingPoly normalized_bounding_poly = 3 ;
54-
5533 // The bounding polygon around the area of interest in the image.
56- // Optional. If it is not specified, system discretion will be applied.
34+ // If it is not specified, system discretion will be applied.
5735 BoundingPoly bounding_poly = 9 ;
5836
59- // Specifies the verbosity of the product search results.
60- // Optional. Defaults to `BASIC`.
61- ProductSearchResultsView view = 4 ;
62-
63- // The resource name of a
64- // [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for
65- // similar images.
37+ // The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images.
6638 //
6739 // Format is:
6840 // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`.
@@ -71,96 +43,82 @@ message ProductSearchParams {
7143 }];
7244
7345 // The list of product categories to search in. Currently, we only consider
74- // the first category, and either "homegoods" or "apparel" should be
75- // specified.
46+ // the first category, and either "homegoods-v2", "apparel-v2", "toys-v2",
47+ // "packagedgoods-v1", or "general-v1" should be specified. The legacy
48+ // categories "homegoods", "apparel", and "toys" are still supported but will
49+ // be deprecated. For new products, please use "homegoods-v2", "apparel-v2",
50+ // or "toys-v2" for better product search accuracy. It is recommended to
51+ // migrate existing products to these categories as well.
7652 repeated string product_categories = 7 ;
7753
7854 // The filtering expression. This can be used to restrict search results based
7955 // on Product labels. We currently support an AND of OR of key-value
80- // expressions, where each expression within an OR must have the same key.
56+ // expressions, where each expression within an OR must have the same key. An
57+ // '=' should be used to connect the key and value.
8158 //
8259 // For example, "(color = red OR color = blue) AND brand = Google" is
83- // acceptable, but not "(color = red OR brand = Google)" or "color: red".
60+ // acceptable, but "(color = red OR brand = Google)" is not acceptable.
61+ // "color: red" is not acceptable because it uses a ':' instead of an '='.
8462 string filter = 8 ;
8563}
8664
8765// Results for a product search request.
8866message ProductSearchResults {
89- // Information about a product.
90- message ProductInfo {
91- // Product ID.
92- string product_id = 1 ;
93-
94- // The URI of the image which matched the query image.
95- //
96- // This field is returned only if `view` is set to `FULL` in
97- // the request.
98- string image_uri = 2 ;
99-
100- // A confidence level on the match, ranging from 0 (no confidence) to
101- // 1 (full confidence).
102- //
103- // This field is returned only if `view` is set to `FULL` in
104- // the request.
105- float score = 3 ;
106- }
107-
10867 // Information about a product.
10968 message Result {
11069 // The Product.
11170 Product product = 1 ;
11271
11372 // A confidence level on the match, ranging from 0 (no confidence) to
11473 // 1 (full confidence).
115- //
116- // This field is returned only if `view` is set to `FULL` in
117- // the request.
11874 float score = 2 ;
11975
12076 // The resource name of the image from the product that is the closest match
12177 // to the query.
12278 string image = 3 ;
12379 }
12480
125- // Product category.
126- // [Deprecated] Use `product_category`.
127- ProductSearchCategory category = 1 ;
81+ // Prediction for what the object in the bounding box is.
82+ message ObjectAnnotation {
83+ // Object ID that should align with EntityAnnotation mid.
84+ string mid = 1 ;
12885
129- // Product category.
130- // Supported values are `bag` and `shoe`.
131- // [Deprecated] `product_category` is provided in each Product .
132- string product_category = 4 ;
86+ // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
87+ // information, see
88+ // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier .
89+ string language_code = 2 ;
13390
134- // Timestamp of the index which provided these results. Changes made after
135- // this time are not reflected in the current results.
136- google.protobuf.Timestamp index_time = 2 ;
91+ // Object name, expressed in its `language_code` language.
92+ string name = 3 ;
13793
138- // List of detected products.
139- repeated ProductInfo products = 3 ;
94+ // Score of the result. Range [0, 1].
95+ float score = 4 ;
96+ }
14097
141- // List of results, one for each product match.
142- repeated Result results = 5 ;
143- }
98+ // Information about the products similar to a single product in a query
99+ // image.
100+ message GroupedResult {
101+ // The bounding polygon around the product detected in the query image.
102+ BoundingPoly bounding_poly = 1 ;
144103
145- // Supported product search categories.
146- enum ProductSearchCategory {
147- // Default value used when a category is not specified.
148- PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0 ;
104+ // List of results, one for each product match.
105+ repeated Result results = 2 ;
149106
150- // Shoes category.
151- SHOES = 1 ;
107+ // List of generic predictions for the object in the bounding box.
108+ repeated ObjectAnnotation object_annotations = 3 ;
109+ }
152110
153- // Bags category.
154- BAGS = 2 ;
155- }
111+ // Timestamp of the index which provided these results. Products added to the
112+ // product set and products removed from the product set after this time are
113+ // not reflected in the current results.
114+ google.protobuf.Timestamp index_time = 2 ;
156115
157- // Specifies the fields to include in product search results.
158- enum ProductSearchResultsView {
159- // Product search results contain only `product_category` and `product_id`.
160- // Default value.
161- BASIC = 0 ;
116+ // List of results, one for each product match.
117+ repeated Result results = 5 ;
162118
163- // Product search results contain `product_category`, `product_id`,
164- // `image_uri`, and `score`.
165- FULL = 1 ;
119+ // List of results grouped by products detected in the query image. Each entry
120+ // corresponds to one bounding polygon in the query image, and contains the
121+ // matching products specific to that region. There may be duplicate product
122+ // matches in the union of all the per-product results.
123+ repeated GroupedResult product_grouped_results = 6 ;
166124}
0 commit comments