code: def resnet_retinanet(
      num_classes,
      backbone="resnet50",
      inputs=None,
      modifier=None,
      **kwargs,
  ):
      """Constructs a retinanet model using a resnet backbone.
  
      Args
          num_classes: Number of classes to predict.
          backbone: Which backbone to use (one of ('resnet50', 'resnet101', 'resnet152')).
          inputs: The inputs to the network (defaults to a Tensor of shape (None, None, 3)).
          modifier: A function handler which can modify the backbone before using it in retinanet (this can be used to freeze backbone layers for example).
  
      Returns
          RetinaNet model with a ResNet backbone.
      """
      # choose default input
      if inputs is None:
          if keras.backend.image_data_format() == "channels_first":
              inputs = keras.layers.Input(shape=(3, None, None))
          else:
              inputs = keras.layers.Input(shape=(None, None, 3))
  
      # create the resnet backbone
      if backbone == "resnet50":
          resnet = keras_resnet.models.ResNet50(
              inputs, include_top=False, freeze_bn=True
          )
      elif backbone == "resnet101":
          resnet = keras_resnet.models.ResNet101(
              inputs, include_top=False, freeze_bn=True
          )
      elif backbone == "resnet152":
          resnet = keras_resnet.models.ResNet152(
              inputs, include_top=False, freeze_bn=True
          )
      else:
          raise ValueError(
              "Backbone ('{}') is invalid.".format(backbone)
          )
  
      # invoke modifier if given
      if modifier:
          resnet = modifier(resnet)
  
      # create the full model
      # resnet.outputs contains 4 layers
      backbone_layers = {
          "C2": resnet.outputs[0],
          "C3": resnet.outputs[1],
          "C4": resnet.outputs[2],
          "C5": resnet.outputs[3],
      }
  
      return retinanet.retinanet(
          inputs=inputs,
          num_classes=num_classes,
          backbone_layers=backbone_layers,
          **kwargs,
      )
  
file_path: ImageAI/imageai_tf_deprecated/Detection/keras_retinanet/models/resnet.py
imports: from tensorflow import keras
  import keras_resnet
  import keras_resnet.models
  from .None import retinanet
  from .None import Backbone
  from ..utils.image import preprocess_image
label_desc: Use image node_id 1 for calling a global function with example usage: resnet_retinanet(num_classes, backbone, inputs, modifier) and returns: retinanet