syntax = "proto3";

package biopb.image;

option java_package = "biopb.image";
option java_multiple_files = true;

import "google/protobuf/any.proto";

message DetectionSettings {

    // Minimal cell area to be consider for detection. The unit is decided by
    // the physical unit of the image, i.e., if the physical pixel size unit is
    // "nm", then the unit here is nm^2 (2D) or nm^3 (3D). However, if the
    // physical pixel size field is not set, then the unit here is `pixels`.
    optional float min_cell_area = 1;


    // Minimal detection score in order to be considered. If unset, the default
    // value is chosen server-side.
    optional float min_score = 2;


    // Threshold for binarize segmentation logits. If unset, default to 0.
    optional float segmentation_threshold = 3;


    // A threshold value for remove overlapping detections. If two detection has
    // an IOU > this threshold, the one with the lower score will be eliminated
    // from the detection list. Nothing will be removed if the field is not set.
    optional float nms_iou = 4;


    oneof resize_info {

        // A hint for the typical cell diameter. If the physical pixel size is
        // known, the value takes the same physical unit. Otherwise, the unit is
        // pixel.
        float cell_diameter_hint = 6;

        // A direct suggestion for image scaling. A nonnegative value. However,
        // requesting a very large scaling factor will likely be refused by the
        // server due to the potential out-of-memory problem.
        float scaling_hint = 7;
    
    }

    // Specify the model name for servers that support more than one model
    // variants.
    string model_name = 8;


    // An opaque data structure that specify a server side model configuration.
    // An important use case is to perform few-shot model adaptations. The model
    // adaptation call returns a new model configuration. This stucture should
    // be included in all new inference requests, so that the server understand
    // that it should perform computation using the adapted model.
    google.protobuf.Any model_configuration = 9;
}
