retinanet
retinanet ¶
niceml implementation of the retinanet This is a modified version of the original implementation
https://github.com/keras-team/keras-io/blob/master/examples/vision/retinanet.py
Classes¶
RetinaNetFactory ¶
Bases: ModelFactory
Modelfactory which creates a RetinaNet for ObjectDetection
Source code in niceml/dlframeworks/keras/models/retinanet.py
Functions¶
build_head ¶
Builds the class/box predictions head.
Parameters:
-
output_filters
–Number of convolution filters in the final layer.
-
bias_init
–Bias Initializer for the final convolution layer.
-
layer_count
(int
, default:256
) –number of layers for convolutions
Returns:
-
–
A keras sequential model representing either the classification or the box regression head depending on
output_filters
.
Source code in niceml/dlframeworks/keras/models/retinanet.py
feature_pyramid ¶
creates a feature pyramid
Source code in niceml/dlframeworks/keras/models/retinanet.py
get_backbone ¶
Builds ResNet50 with pre-trained imagenet weights
Source code in niceml/dlframeworks/keras/models/retinanet.py
retina_net ¶
retina_net(
feature_layers,
num_classes,
anchor_per_cell,
coordinates_count,
anchor_feature_count_list,
)
Builds the heads of the feature_layers and returns one output tensor
:param feature_layers: tensors with all feature maps :param num_classes: count of classes :param anchor_per_cell: how many anchors are generated per feature cell :param coordinates_count: how many coordinates are required to represent the object (e.g. bounding box) :param anchor_feature_count_list: a list of anchors per feature map :return: output_tensor with shape [batch_size, num_anchors, coordinates_count + num_classes]