public final class SingleShotDetection
extends ai.djl.nn.AbstractBlock
SingleShotDetection is an implementation of Block that implements a Single Shot
Detection (SSD) model for object detection.| Modifier and Type | Class and Description |
|---|---|
static class |
SingleShotDetection.Builder
The Builder to construct a
SingleShotDetection. |
| Modifier and Type | Method and Description |
|---|---|
static SingleShotDetection.Builder |
builder()
Creates a builder to build a
SingleShotDetection. |
protected ai.djl.ndarray.NDList |
forwardInternal(ai.djl.training.ParameterStore parameterStore,
ai.djl.ndarray.NDList inputs,
boolean training,
ai.djl.util.PairList<java.lang.String,java.lang.Object> params) |
static ai.djl.nn.convolutional.Conv2d |
getAnchorPredictionBlock(int numAnchors)
Creates a anchor prediction block used in an SSD.
|
static ai.djl.nn.convolutional.Conv2d |
getClassPredictionBlock(int numAnchors,
int numClasses)
Creates a class prediction block used in an SSD.
|
static ai.djl.nn.SequentialBlock |
getDownSamplingBlock(int numFilters)
Creates a
Block that reduces the size of a convolutional block by half. |
ai.djl.ndarray.types.Shape[] |
getOutputShapes(ai.djl.ndarray.types.Shape[] inputShapes) |
void |
initialize(ai.djl.ndarray.NDManager manager,
ai.djl.ndarray.types.DataType dataType,
ai.djl.ndarray.types.Shape... inputShapes) |
void |
loadMetadata(byte version,
java.io.DataInputStream is) |
addChildBlock, addParameter, beforeInitialize, cast, clear, describeInput, forward, forward, forwardInternal, getChildren, getDirectParameters, getParameters, initializeChildBlocks, isInitialized, loadParameters, prepare, readInputShapes, saveInputShapes, saveMetadata, saveParameters, setInitializer, setInitializer, setInitializer, toStringprotected ai.djl.ndarray.NDList forwardInternal(ai.djl.training.ParameterStore parameterStore,
ai.djl.ndarray.NDList inputs,
boolean training,
ai.djl.util.PairList<java.lang.String,java.lang.Object> params)
forwardInternal in class ai.djl.nn.AbstractBlockpublic ai.djl.ndarray.types.Shape[] getOutputShapes(ai.djl.ndarray.types.Shape[] inputShapes)
public void initialize(ai.djl.ndarray.NDManager manager,
ai.djl.ndarray.types.DataType dataType,
ai.djl.ndarray.types.Shape... inputShapes)
initialize in interface ai.djl.nn.Blockinitialize in class ai.djl.nn.AbstractBlockpublic void loadMetadata(byte version,
java.io.DataInputStream is)
throws java.io.IOException,
ai.djl.MalformedModelException
loadMetadata in class ai.djl.nn.AbstractBlockjava.io.IOExceptionai.djl.MalformedModelExceptionpublic static ai.djl.nn.SequentialBlock getDownSamplingBlock(int numFilters)
Block that reduces the size of a convolutional block by half.numFilters - the number of filtersBlock that reduces the size of a convolutional block by halfpublic static ai.djl.nn.convolutional.Conv2d getClassPredictionBlock(int numAnchors,
int numClasses)
numAnchors - the number of anchorsnumClasses - the number of classespublic static ai.djl.nn.convolutional.Conv2d getAnchorPredictionBlock(int numAnchors)
numAnchors - the number of anchorspublic static SingleShotDetection.Builder builder()
SingleShotDetection.