code: def input_coco(
      images_path,
      annotations_path,
      device,
      shard_id,
      num_shards,
      random_shuffle=True,
  ):
      encoded, bboxes, classes = dali.fn.readers.coco(
          file_root=images_path,
          annotations_file=annotations_path,
          ratio=True,
          ltrb=True,
          shard_id=shard_id,
          num_shards=num_shards,
          random_shuffle=random_shuffle,
      )
  
      images = dali.fn.decoders.image(
          encoded,
          device="mixed" if device == "gpu" else "cpu",
          output_type=dali.types.RGB,
      )
  
      shape = dali.fn.peek_image_shape(encoded, dtype=dali.types.FLOAT)
      heights = shape[0]
      widths = shape[1]
  
      return (
          images,
          bboxes,
          classes,
          widths,
          heights,
      )
  
imports: import math
  import nvidia.dali
label_desc: Use image node_id 2 for calling a global function with example usage: input_coco(images_path, annotations_path, device, shard_id, num_shards, random_shuffle) and returns: images,  bboxes,  classes,  widths,  heights