web_detection.proto 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // Copyright 2022 Google LLC
  2. //
  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
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  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.
  14. syntax = "proto3";
  15. package google.cloud.vision.v1;
  16. option cc_enable_arenas = true;
  17. option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "WebDetectionProto";
  20. option java_package = "com.google.cloud.vision.v1";
  21. option objc_class_prefix = "GCVN";
  22. // Relevant information for the image from the Internet.
  23. message WebDetection {
  24. // Entity deduced from similar images on the Internet.
  25. message WebEntity {
  26. // Opaque entity ID.
  27. string entity_id = 1;
  28. // Overall relevancy score for the entity.
  29. // Not normalized and not comparable across different image queries.
  30. float score = 2;
  31. // Canonical description of the entity, in English.
  32. string description = 3;
  33. }
  34. // Metadata for online images.
  35. message WebImage {
  36. // The result image URL.
  37. string url = 1;
  38. // (Deprecated) Overall relevancy score for the image.
  39. float score = 2;
  40. }
  41. // Metadata for web pages.
  42. message WebPage {
  43. // The result web page URL.
  44. string url = 1;
  45. // (Deprecated) Overall relevancy score for the web page.
  46. float score = 2;
  47. // Title for the web page, may contain HTML markups.
  48. string page_title = 3;
  49. // Fully matching images on the page.
  50. // Can include resized copies of the query image.
  51. repeated WebImage full_matching_images = 4;
  52. // Partial matching images on the page.
  53. // Those images are similar enough to share some key-point features. For
  54. // example an original image will likely have partial matching for its
  55. // crops.
  56. repeated WebImage partial_matching_images = 5;
  57. }
  58. // Label to provide extra metadata for the web detection.
  59. message WebLabel {
  60. // Label for extra metadata.
  61. string label = 1;
  62. // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn".
  63. // For more information, see
  64. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  65. string language_code = 2;
  66. }
  67. // Deduced entities from similar images on the Internet.
  68. repeated WebEntity web_entities = 1;
  69. // Fully matching images from the Internet.
  70. // Can include resized copies of the query image.
  71. repeated WebImage full_matching_images = 2;
  72. // Partial matching images from the Internet.
  73. // Those images are similar enough to share some key-point features. For
  74. // example an original image will likely have partial matching for its crops.
  75. repeated WebImage partial_matching_images = 3;
  76. // Web pages containing the matching images from the Internet.
  77. repeated WebPage pages_with_matching_images = 4;
  78. // The visually similar image results.
  79. repeated WebImage visually_similar_images = 6;
  80. // The service's best guess as to the topic of the request image.
  81. // Inferred from similar images on the open web.
  82. repeated WebLabel best_guess_labels = 8;
  83. }