<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/vision/modeling/factory.py#L260-L375) |

Builds a RetinaNet model.

    tfm.vision.factory.build_retinanet(
        input_specs: tf_keras.layers.InputSpec,
        model_config: https://www.tensorflow.org/api_docs/python/tfm/vision/configs/retinanet/RetinaNet,
        l2_regularizer: Optional[tf_keras.regularizers.Regularizer] = None,
        backbone: Optional[tf_keras.Model] = None,
        decoder: Optional[tf_keras.Model] = None,
        num_anchors_per_location: (int | dict[str, int] | None) = None,
        anchor_boxes: (Mapping[str, tf.Tensor] | None) = None
    ) -> tf_keras.Model

<br />

<br />

<br />

| ## Args ||
|---|---|
| `input_specs` | The InputSpec of the input image tensor to the model. |
| `model_config` | The RetinaNet model configuration to build from. |
| `l2_regularizer` | Optional l2 regularizer to use for building the backbone, decorder, and head. |
| `backbone` | Optional instance of the backbone model. |
| `decoder` | Optional instance of the decoder model. |
| `num_anchors_per_location` | Optional number of anchors per pixel location for building the RetinaNetHead. If an `int`, the same number is used for all levels. If a `dict`, it specifies the number at each level. If `none`, it uses `len(aspect_ratios) * num_scales` from the anchor config by default. |
| `anchor_boxes` | Optional fixed multilevel anchor boxes for inference. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| RetinaNet model. ||

<br />