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.Object
The Builder to construct aSingleShotDetection
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleShotDetection
build()
Builds aSingleShotDetection
block.SingleShotDetection.Builder
optFeatures(java.util.List<ai.djl.nn.Block> features)
Sets theConv2d
blocks to be appended to the network to get multi-output network.SingleShotDetection.Builder
optGlobalPool(boolean globalPool)
Sets the boolean whether to attach a global average pooling layer as the last output layer.SingleShotDetection.Builder
setBaseNetwork(ai.djl.nn.Block network)
Sets the base network for the SSD framework.SingleShotDetection.Builder
setNumClasses(int numClasses)
Sets the number of classes of objects to be detected.SingleShotDetection.Builder
setNumFeatures(int numFeatures)
Sets the number of down sampling blocks to be applied.SingleShotDetection.Builder
setRatios(java.util.List<java.util.List<java.lang.Float>> ratios)
Sets the list of aspect ratios of generated anchor boxes.SingleShotDetection.Builder
setSizes(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 theConv2d
blocks to be appended to the network to get multi-output network.- Parameters:
features
- List ofConv2d
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 aSingleShotDetection
block.- Returns:
- the
SingleShotDetection
block
-
-