code: def _define_pipeline(self):
      if self._input_type == InputType.tfrecord:
          (
              images,
              bboxes,
              classes,
              widths,
              heights,
          ) = ops_util.input_tfrecord(
              self._tfrecord_files,
              self._tfrecord_idxs,
              device=self._device,
              shard_id=self._shard_id,
              num_shards=self._num_shards,
              random_shuffle=self._is_training,
          )
      elif self._input_type == InputType.coco:
          (
              images,
              bboxes,
              classes,
              widths,
              heights,
          ) = ops_util.input_coco(
              self._images_path,
              self._annotations_path,
              device=self._device,
              shard_id=self._shard_id,
              num_shards=self._num_shards,
              random_shuffle=self._is_training,
          )
  
      if self._is_training and self._gridmask:
          images = ops_util.gridmask(images, widths, heights)
  
      images, bboxes = ops_util.normalize_flip(
          images, bboxes, 0.5 if self._is_training else 0.0
      )
  
      images, bboxes, classes = ops_util.random_crop_resize(
          images,
          bboxes,
          classes,
          widths,
          heights,
          self._image_size,
          [0.1, 2.0] if self._is_training else None,
      )
  
      if self._device == "gpu":
          bboxes = bboxes.gpu()
          classes = classes.gpu()
  
      enc_bboxes, enc_classes = dali.fn.box_encoder(
          bboxes, classes, anchors=self._boxes, offset=True
      )
      num_positives = dali.fn.reductions.sum(
          dali.fn.cast(enc_classes != 0, dtype=dali.types.FLOAT),
      )
      enc_classes -= 1
  
      # convert to tlbr
      enc_bboxes = dali.fn.coord_transform(
          enc_bboxes, M=[0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0]
      )
  
      # split into layers by size
      enc_bboxes_layers, enc_classes_layers = self._unpack_labels(
          enc_bboxes, enc_classes
      )
  
      # interleave enc_bboxes_layers and enc_classes_layers
      enc_layers = [
          item
          for pair in zip(enc_classes_layers, enc_bboxes_layers)
          for item in pair
      ]
  
      bboxes = ops_util.bbox_to_effdet_format(bboxes, self._image_size)
      bboxes = dali.fn.pad(
          bboxes,
          fill_value=-1,
          shape=(self._max_instances_per_image, 4),
      )
      classes = dali.fn.pad(
          classes,
          fill_value=-1,
          shape=(self._max_instances_per_image,),
      )
  
      return images, num_positives, bboxes, classes, *enc_layers
  
file_path: DALI/docs/examples/use_cases/tensorflow/efficientdet/pipeline/dali/efficientdet_pipeline.py
imports: import nvidia.dali
  from nvidia.dali import pipeline_def
  import nvidia.dali.plugin.tf
  import tensorflow
  import math
  from absl import logging
  from glob import glob
  from pipeline import anchors
  from utils import InputType
  from .None import ops_util
label_desc: Use image node_id 3 for calling the EfficientDetPipeline obj's underlying member method code with example usage: obj._define_pipeline() and returns: images,  num_positives,  bboxes,  classes,  unknown