syntax = "proto3";
package aimdk.protocol;

import "aimdk/protocol/common/header.proto";
import "aimdk/protocol/common/box.proto";
import "aimdk/protocol/skill/common/common.proto";

/**
 * @brief ...
 */
message Prompt {
  message Point {
    float x = 1;
    float y = 2;
    float type = 3;
  }

  repeated string prompt_mode = 1;

  // choices in [mask, box, class]
  repeated string results_select = 2;

  int32 num_inst_select = 3;
  float threshold_select = 4;
  float mask_image_mix_ration = 5;

  // when prompt_mode = categories
  string categoryname = 6;

  string custom_category = 7;

  // when prompt_mode = expression
  string expression = 8;

  // when prompt_mode = points
  repeated Point point_prompt = 9;

  // when prompt_mode = boxes
  repeated Box box_prompts = 10;
}

/**
 * @brief ...
 */
message ModelResults {
  int32 width = 1;
  int32 height = 2;

  repeated IntegerList masks = 3;
  repeated float scores = 4;
  repeated int32 classes = 5;
  repeated Box boxes = 6;

  bytes image = 7;
}

/**
 * @brief ...
 */
message GLEERequest {
  RequestHeader header = 1;

  string model_selection = 2;

  int32 height = 3;
  int32 width = 4;
  bytes image = 5;

  repeated Prompt prompts = 6;
  bool return_image = 7;
}

/**
 * @brief ...
 */
message GLEEResponse {
  ResponseHeader header = 1;
  repeated ModelResults results = 2;
}

/**
 * @brief ...
 */
service GLEEService {
  /**
   * @brief ...
   * @param  GLEERequest  ...
   * @return GLEEResponse ...
   */
  rpc Predict(GLEERequest) returns (GLEEResponse);
}
