Skip to content

Commit 4c8ac5c

Browse files
Google APIscopybara-github
authored andcommitted
fix!: Product search related messages and enums changed in an incompatible way
fix!: NormalizedBoundingPoly message removed PiperOrigin-RevId: 446837836
1 parent ca17771 commit 4c8ac5c

2 files changed

Lines changed: 50 additions & 99 deletions

File tree

google/cloud/vision/v1p3beta1/geometry.proto

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google Inc.
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.
@@ -16,13 +16,12 @@ syntax = "proto3";
1616

1717
package google.cloud.vision.v1p3beta1;
1818

19-
import "google/api/annotations.proto";
20-
2119
option cc_enable_arenas = true;
2220
option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision";
2321
option java_multiple_files = true;
2422
option java_outer_classname = "GeometryProto";
2523
option java_package = "com.google.cloud.vision.v1p3beta1";
24+
option objc_class_prefix = "GCVN";
2625

2726
// A vertex represents a 2D point in the image.
2827
// NOTE: the vertex coordinates are in the same scale as the original image.
@@ -54,12 +53,6 @@ message BoundingPoly {
5453
repeated NormalizedVertex normalized_vertices = 2;
5554
}
5655

57-
// A normalized bounding polygon around a portion of an image.
58-
message NormalizedBoundingPoly {
59-
// Normalized vertices of the bounding polygon.
60-
repeated NormalizedVertex vertices = 1;
61-
}
62-
6356
// A 3D position in the image, used primarily for Face detection landmarks.
6457
// A valid Position must have both x and y coordinates.
6558
// The position coordinates are in the same scale as the original image.
Lines changed: 48 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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.
@@ -11,13 +11,11 @@
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

1615
syntax = "proto3";
1716

1817
package google.cloud.vision.v1p3beta1;
1918

20-
import "google/api/annotations.proto";
2119
import "google/api/resource.proto";
2220
import "google/cloud/vision/v1p3beta1/geometry.proto";
2321
import "google/cloud/vision/v1p3beta1/product_search_service.proto";
@@ -28,41 +26,15 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta
2826
option java_multiple_files = true;
2927
option java_outer_classname = "ProductSearchProto";
3028
option java_package = "com.google.cloud.vision.v1p3beta1";
29+
option objc_class_prefix = "GCVN";
3130

3231
// Parameters for a product search request.
3332
message 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.
8866
message 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

Comments
 (0)