code: def __init__(
      self,
      params,
      batch_size,
      args,
      is_training=True,
      num_shards=1,
      device_id=0,
      cpu_only=False,
  ):
      self._batch_size = batch_size
      self._image_size = params["image_size"]
      self._gridmask = params["grid_mask"]
  
      self._input_type = args.input_type
      if self._input_type == InputType.tfrecord:
          if is_training:
              file_pattern = args.train_file_pattern
          else:
              file_pattern = (
                  args.eval_file_pattern or args.train_file_pattern
              )
  
          self._tfrecord_files = glob(file_pattern)
          self._tfrecord_idxs = [
              filename + "_idx" for filename in self._tfrecord_files
          ]
      else:
          self._images_path = args.images_path
          self._annotations_path = args.annotations_path
  
      self._is_training = is_training
      self._num_shards = num_shards
      self._shard_id = None if cpu_only else device_id
      self._device = "cpu" if cpu_only else "gpu"
  
      self._anchors = anchors.Anchors(
          3, 7, 3, [1.0, 2.0, 0.5], 4.0, params["image_size"]
      )
      self._boxes = self._get_boxes()
      self._max_instances_per_image = (
          params["max_instances_per_image"] or 100
      )
      seed = params["seed"] or -1
  
      self._pipe = self._define_pipeline(
          batch_size=self._batch_size,
          num_threads=self._num_shards,
          device_id=device_id,
          seed=seed,
      )
  
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 1 to create a new EfficientDetPipeline object  with example: obj = EfficientDetPipeline(params, batch_size, args, is_training, num_shards, device_id, cpu_only)