code: def tinyyolov2(
      x,
      stem_fn,
      stem_out=None,
      is_training=False,
      classes=20,
      scope=None,
      reuse=None,
  ):
      inputs = x
      opt = opts("tinyyolov2" + data_name(classes))
      stem = x = stem_fn(x, is_training, stem=True, scope="stem")
  
      if stem_out is not None:
          stem = x = remove_head(x, stem_out)
  
      x = max_pool2d(x, 2, stride=1, scope="pool6")
      x = darkconv(x, 1024, 3, scope="conv7")
      x = darkconv(x, 1024 if classes == 20 else 512, 3, scope="conv8")
      x = darkconv(
          x, (classes + 5) * 5, 1, onlyconv=True, scope="linear"
      )
      x.aliases = []
  
      def get_boxes(*args, **kwargs):
          return yolo_boxes(opt, *args, **kwargs)
  
      x.get_boxes = get_boxes
      x.stem = stem
      x.inputs = [inputs]
      x.inputs += v2_inputs(x.shape[1:3], opt["num"], classes, x.dtype)
      if isinstance(is_training, tf.Tensor):
          x.inputs.append(is_training)
      x.loss = v2_loss(x, opt["anchors"], classes)
      return x
  
imports: from __future__ import absolute_import
  from __future__ import division
  import tensorflow
  from .layers import batch_norm
  from .layers import bias_add
  from .layers import conv2d
  from .layers import darkconv
  from .layers import dropout
  from .layers import flatten
  from .layers import fc
  from .layers import max_pool2d
  from .ops import *
  from .utils import remove_head
  from .utils import set_args
  from .utils import var_scope
  from .references.yolos import get_v2_boxes
  from .references.yolos import opts
  from .references.yolos import v2_inputs
  from .references.yolos import v2_loss
  from .references.rcnns import get_boxes
  from .references.rcnns import roi_pool2d
  from .references.rcnns import rp_net
label_desc: Use image node_id 5 for calling a global function with example usage: tinyyolov2(x, stem_fn, stem_out, is_training, classes, scope, reuse) and returns: x, yolo_boxes