hw.proto 1.7 KB

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