Class SingleShotDetection.Builder
- java.lang.Object
-
- ai.djl.basicmodelzoo.cv.object_detection.ssd.SingleShotDetection.Builder
-
- Enclosing class:
- SingleShotDetection
public static class SingleShotDetection.Builder extends java.lang.ObjectThe Builder to construct aSingleShotDetection.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleShotDetectionbuild()Builds aSingleShotDetectionblock.SingleShotDetection.BuilderoptFeatures(java.util.List<ai.djl.nn.Block> features)Sets theConv2dblocks to be appended to the network to get multi-output network.SingleShotDetection.BuilderoptGlobalPool(boolean globalPool)Sets the boolean whether to attach a global average pooling layer as the last output layer.SingleShotDetection.BuildersetBaseNetwork(ai.djl.nn.Block network)Sets the base network for the SSD framework.SingleShotDetection.BuildersetNumClasses(int numClasses)Sets the number of classes of objects to be detected.SingleShotDetection.BuildersetNumFeatures(int numFeatures)Sets the number of down sampling blocks to be applied.SingleShotDetection.BuildersetRatios(java.util.List<java.util.List<java.lang.Float>> ratios)Sets the list of aspect ratios of generated anchor boxes.SingleShotDetection.BuildersetSizes(java.util.List<java.util.List<java.lang.Float>> sizes)Sets the list of sizes of generated anchor boxes.
-
-
-
Method Detail
-
setSizes
public SingleShotDetection.Builder setSizes(java.util.List<java.util.List<java.lang.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(java.util.List<java.util.List<java.lang.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(java.util.List<ai.djl.nn.Block> features)
Sets theConv2dblocks to be appended to the network to get multi-output network.- Parameters:
features- List ofConv2dblocks 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 aSingleShotDetectionblock.- Returns:
- the
SingleShotDetectionblock
-
-