8. SSD model in Keras
Listing 11.8.1 shows the SSD model creation function build_ssd()
. The model is illustrated in Figure 11.5.1. The function retrieves n_layers
of output features from the backbone or base network by calling base_outputs = backbone(inputs)
.
In this book, the backbone()
is build_resnet()
. The ResNet models that can be generated by build_resnet()
are similar to the residual networks discussed in Chapter 2, Deep Neural Networks. The build_resnet()
function can be replaced by any function name that builds the base network.
As shown in Figure 11.5.1, the return value base_outputs
is a list of output features that will be the input to class and offset prediction layers. For example, the first output base_outputs[0]
, is used to generate n1 class predictions and n1 offset predictions.
In the for
loop of build_ssd()
the class prediction is the classes
variable, while the offsets prediction is the offsets
variable. After the for
loop iteration, the class predictions...