class_docstr: Creates TFDS examples for the Detection track.
class_docstr_tok: ["Creates","TFDS","examples","for","the","Detection","track","."]
code: def process(self, element):
      filename, image_bytes = element
      image_id = os.path.basename(filename).split(".")[0]
      # Image-level annotations.
      objects = []
      if self._image2labels:
          for label, source, confidence in self._image2labels[image_id]:
              objects.append(
                  {
                      "label": self._mid2int[label],
                      "source": source,
                      "confidence": confidence,
                  }
              )
      # Bounding box-level annotations.
      bobjects = []
      if self._image2boxes:
          for annotation in self._image2boxes[image_id]:
              label, xmin, xmax, ymin, ymax, is_group_of = annotation
              bbox = tfds.features.BBox(
                  xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax
              )
              bobjects.append(
                  {
                      "label": self._mid2int[label],
                      "bbox": bbox,
                      "is_group_of": is_group_of,
                  }
              )
  
      yield image_id, {
          "id": image_id,
          "image": image_bytes,
          "objects": objects,
          "bobjects": bobjects,
      }
  
imports: import collections
  import csv
  import io
  import json
  import os
  from absl import logging
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the CreateDetectionExampleFn obj's underlying member method code with example usage: obj.process(element) without return types