Class MultiBoxDetection.Builder

java.lang.Object
ai.djl.modality.cv.MultiBoxDetection.Builder
Enclosing class:
MultiBoxDetection

public static final class MultiBoxDetection.Builder extends Object
The Builder to construct a MultiBoxDetection object.
  • Method Details

    • optClip

      public MultiBoxDetection.Builder optClip(boolean clip)
      Sets the boolean parameter that indicates whether to clip out-of-boundary boxes. It is set to true by default.
      Parameters:
      clip - whether to clip out-of-boundary boxes
      Returns:
      this Builder
    • optForceSuppress

      public MultiBoxDetection.Builder optForceSuppress(boolean forceSuppress)
      Sets the boolean parameter that indicates whether to suppress all detections regardless of class_id. It is set to false by default.
      Parameters:
      forceSuppress - whether to suppress all detections regardless of class_id
      Returns:
      this Builder
    • optBackgroundId

      public MultiBoxDetection.Builder optBackgroundId(int backgroundId)
      Sets the class ID for the background. Defaults to 0.
      Parameters:
      backgroundId - the class ID for the background
      Returns:
      this Builder
    • optNmsTopK

      public MultiBoxDetection.Builder optNmsTopK(int nmsTopK)
      Sets the boolean parameter that indicates whether to clip out-of-boundary boxes. Defaults to -1 which implies that there is no limit.
      Parameters:
      nmsTopK - whether to clip out-of-boundary boxes
      Returns:
      this Builder
    • optThreshold

      public MultiBoxDetection.Builder optThreshold(float threshold)
      Sets the threshold score for a detection to be a positive prediction. Defaults to 0.01.
      Parameters:
      threshold - the threshold score for a detection to be a positive prediction
      Returns:
      this Builder
    • optNmsThreshold

      public MultiBoxDetection.Builder optNmsThreshold(float nmsThreshold)
      Sets the non-maximum suppression(NMS) threshold. Defaults to 0.5.
      Parameters:
      nmsThreshold - the non-maximum suppression(NMS) threshold
      Returns:
      this Builder
    • build

      public MultiBoxDetection build()
      Builds a MultiBoxDetection block.
      Returns:
      the MultiBoxDetection block