hw.proto 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2021 EMQ Technologies Co., Ltd.
  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. option go_package = "grpc/helloworld";
  16. option java_multiple_files = true;
  17. option java_package = "io.grpc.examples.helloworld";
  18. option java_outer_classname = "HelloWorldProto";
  19. package helloworld;
  20. import "google/protobuf/empty.proto";
  21. import "google/protobuf/wrappers.proto";
  22. // The greeting service definition.
  23. service Greeter {
  24. // Sends a greeting
  25. rpc SayHello(HelloRequest) returns (HelloReply) {}
  26. rpc Compute (InferRequest) returns (Response) {}
  27. // Primitive type param. Not supported for rest json
  28. rpc get_feature(google.protobuf.BytesValue) returns(FeatureResponse) {}
  29. rpc object_detection(ObjectDetectionRequest) returns(ObjectDetectionResponse) {}
  30. rpc getStatus(google.protobuf.Empty) returns(google.protobuf.BoolValue) {}
  31. rpc RestEncodedJson(google.protobuf.StringValue) returns(google.protobuf.StringValue) {}
  32. }
  33. // The request message containing the user's name.
  34. message HelloRequest {
  35. string name = 1;
  36. }
  37. // The response message containing the greetings
  38. message HelloReply {
  39. string message = 1;
  40. }
  41. message Response {
  42. uint32 code = 1;
  43. string msg = 2;
  44. }
  45. message InferRequest {
  46. string rid = 1;
  47. string uuid = 2;
  48. string outlet = 3;
  49. string path = 4;
  50. bytes data = 5;
  51. string extra = 6;
  52. }
  53. message Box{
  54. int32 x = 1;
  55. int32 y = 2;
  56. int32 w = 3;
  57. int32 h = 4;
  58. }
  59. message FeatureResult{
  60. repeated float features = 1;
  61. Box box = 2;
  62. }
  63. message FeatureResponse{
  64. repeated FeatureResult feature = 1;
  65. }
  66. message ObjectDetectionRequest {
  67. string cmd = 1;
  68. string base64_img = 2 [json_name="base64_img"];
  69. }
  70. message ObjectDetectionResponse {
  71. string info = 1;
  72. int32 code = 2;
  73. string image = 3;
  74. string result = 4;
  75. string type = 5;
  76. }