code: def __next__(self):
      with tf.device("/cpu:0"):
          num = 0
          if self._batch_id == self._num_batches:
              self._batch_id = 0
              np.random.shuffle(self._image_ids)
  
          start = self._batch_size * (
              self._batch_id * self._num_threads + self._device_id
          )
          image_ids = self._image_ids[start : start + self._batch_size]
  
          images, bboxes, classes = self._input(image_ids)
          if self._is_training:
              self._color_twist(images)
              self._flip(images, bboxes)
              if self._use_mosaic:
                  images, bboxes, classes = self._mosaic(
                      images, bboxes, classes
                  )
  
          self._batch_id += 1
  
          lengths = [len(b) for b in bboxes]
          bboxes = tf.RaggedTensor.from_row_lengths(
              tf.concat(bboxes, axis=0), lengths
          )
          bboxes = bboxes.to_tensor(-1)
          bboxes = tf.cast(bboxes, dtype=tf.float32)
  
          classes = tf.ragged.stack(classes)
          if self._batch_size > 1:
              classes = classes.to_tensor(-1)
          classes = tf.cast(
              tf.expand_dims(classes, axis=-1), dtype=tf.float32
          )
  
          return images, tf.concat([bboxes, classes], axis=-1)
  
file_path: DALI/docs/examples/use_cases/tensorflow/yolov4/src/np/pipeline.py
imports: from .coco import COCO
  import numpy
  import tensorflow
  import os
  import cv2
  import random
label_desc: Use image node_id 3 for calling the YOLOv4PipelineNumpy obj's underlying member method code with example usage: obj.__next__() and returns: images,  tf