Class SingleShotDetection.Builder

java.lang.Object
ai.djl.basicmodelzoo.cv.object_detection.ssd.SingleShotDetection.Builder
Enclosing class:
SingleShotDetection

public static class SingleShotDetection.Builder extends Object
The Builder to construct a SingleShotDetection.
  • Method Details

    • setSizes

      public SingleShotDetection.Builder setSizes(List<List<Float>> sizes)
      Sets the list of sizes of generated anchor boxes.
      Parameters:
      sizes - size of the input
      Returns:
      Returns this Builder
    • setRatios

      public SingleShotDetection.Builder setRatios(List<List<Float>> ratios)
      Sets the list of aspect ratios of generated anchor boxes.
      Parameters:
      ratios - size of the input
      Returns:
      Returns this Builder
    • setNumClasses

      public SingleShotDetection.Builder setNumClasses(int numClasses)
      Sets the number of classes of objects to be detected.
      Parameters:
      numClasses - number of classes
      Returns:
      Returns this Builder
    • setBaseNetwork

      public SingleShotDetection.Builder setBaseNetwork(ai.djl.nn.Block network)
      Sets the base network for the SSD framework.
      Parameters:
      network - Base network
      Returns:
      Returns this Builder
    • setNumFeatures

      public SingleShotDetection.Builder setNumFeatures(int numFeatures)
      Sets the number of down sampling blocks to be applied. Down-sampling blocks are applied to the base network successively, and feature maps are drawn from the each of the blocks. This value is ignored if features is also set.
      Parameters:
      numFeatures - Number of down sampling blocks to be applied
      Returns:
      Returns this Builder
    • optFeatures

      public SingleShotDetection.Builder optFeatures(List<ai.djl.nn.Block> features)
      Sets the Conv2d blocks to be appended to the network to get multi-output network.
      Parameters:
      features - List of Conv2d blocks to be appended
      Returns:
      Returns this Builder
    • optGlobalPool

      public SingleShotDetection.Builder optGlobalPool(boolean globalPool)
      Sets the boolean whether to attach a global average pooling layer as the last output layer.
      Parameters:
      globalPool - Whether to attach a global average pooling layer as the last output layer
      Returns:
      Returns this Builder
    • build

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