web_detection.proto 3.4 KB

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