class_docstr: DALI partial pipeline with COCO Reader and loader. To be passed as
  a parameter of a DALI transform pipeline.
  
  Parameters
  ----------
  num_shards: int
       DALI pipeline arg - Number of auto used, indicating to the reader
       how to split/shard the dataset.
  shard_id: int
       DALI pipeline arg - Shard id of the pipeline must be in [0, num_shards).
  file_root
      Directory containing the COCO dataset.
  annotations_file
      The COCO annotation file to read from.
  device_id: int
       GPU device used for the DALI pipeline.
class_docstr_tok: ["DALI","partial","pipeline","with","COCO","Reader","and","loader",".","To","be","passed","as","a","parameter","of","a","DALI","transform","pipeline",".","Parameters","--","--","--","--","--","num_shards",":","int","DALI","pipeline","arg","-","Number","of","auto","used",",","indicating","to","the","reader","how","to","split\/shard","the","dataset",".","shard_id",":","int","DALI","pipeline","arg","-","Shard","id","of","the","pipeline","must","be","in","[","0",",","num_shards",")",".","file_root","Directory","containing","the","COCO","dataset",".","annotations_file","The","COCO","annotation","file","to","read","from",".","device_id",":","int","GPU","device","used","for","the","DALI","pipeline","."]
code: def __init__(
      self, num_shards, shard_id, file_root, annotations_file, device_id
  ):
      self.input = dali.ops.COCOReader(
          file_root=file_root,
          annotations_file=annotations_file,
          skip_empty=True,
          shard_id=shard_id,
          num_shards=num_shards,
          ratio=True,
          ltrb=True,
          shuffle_after_epoch=True,
      )
  
      self.decode = dali.ops.ImageDecoder(
          device="cpu", output_type=dali.types.RGB
      )
  
      # We need to build the COCOReader ops to parse the annotations
      # and have acces to the dataset size.
      # TODO(spanev): Replace by DALI standalone ops when available
      class DummyMicroPipe(dali.Pipeline):
          """Dummy pipeline which sole purpose is to build COCOReader
          and get the epoch size. To be replaced by DALI standalone op, when available.
          """
  
          def __init__(self, device_id):
              super(DummyMicroPipe, self).__init__(
                  batch_size=1, device_id=device_id, num_threads=1
              )
              self.input = dali.ops.COCOReader(
                  file_root=file_root, annotations_file=annotations_file
              )
  
          def define_graph(self):
              inputs, bboxes, labels = self.input(name="Reader")
              return (inputs, bboxes, labels)
  
      micro_pipe = DummyMicroPipe(device_id=device_id)
      micro_pipe.build()
      self._size = micro_pipe.epoch_size(name="Reader")
      del micro_pipe
  
imports: from __future__ import absolute_import
  from __future__ import division
  import os
  import numpy
  from PIL import Image
  import mxnet
  from .utils import try_import_pycocotools
  from ..base import VisionDataset
  from ...utils import try_import_dali
  from ...utils.bbox import bbox_xywh_to_xyxy, bbox_clip_xyxy
label_desc: Use image node_id 1 to create a new COCODetectionDALI object from inherited base classes: object with example: obj = COCODetectionDALI(num_shards, shard_id, file_root, annotations_file, device_id)