Class SingleShotDetection.Builder
java.lang.Object
ai.djl.basicmodelzoo.cv.object_detection.ssd.SingleShotDetection.Builder
- Enclosing class:
- SingleShotDetection
The Builder to construct a
SingleShotDetection
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aSingleShotDetection
block.optFeatures
(List<ai.djl.nn.Block> features) Sets theConv2d
blocks to be appended to the network to get multi-output network.optGlobalPool
(boolean globalPool) Sets the boolean whether to attach a global average pooling layer as the last output layer.setBaseNetwork
(ai.djl.nn.Block network) Sets the base network for the SSD framework.setNumClasses
(int numClasses) Sets the number of classes of objects to be detected.setNumFeatures
(int numFeatures) Sets the number of down sampling blocks to be applied.Sets the list of aspect ratios of generated anchor boxes.Sets the list of sizes of generated anchor boxes.
-
Method Details
-
setSizes
Sets the list of sizes of generated anchor boxes.- Parameters:
sizes
- size of the input- Returns:
- Returns this Builder
-
setRatios
Sets the list of aspect ratios of generated anchor boxes.- Parameters:
ratios
- size of the input- Returns:
- Returns this Builder
-
setNumClasses
Sets the number of classes of objects to be detected.- Parameters:
numClasses
- number of classes- Returns:
- Returns this Builder
-
setBaseNetwork
Sets the base network for the SSD framework.- Parameters:
network
- Base network- Returns:
- Returns this Builder
-
setNumFeatures
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
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
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
Builds aSingleShotDetection
block.- Returns:
- the
SingleShotDetection
block
-