class_docstr: Reads data suitable for object detection.
  
  The object detection task needs the following information:
      - images.
      - ground truth, rectangular bounding boxes with associated labels.
  
  For implementing a subclass of object detection, one needs to implement
  the following methods:
      - __init__
      - get_total
      - get_classes
      - iterate
  
  Optionally:
      - pretty_name
  
  Additionally, must use the `_per_class_counter` variable to honor the max
  number of examples per class in an efficient way.
class_docstr_tok: ["Reads","data","suitable","for","object","detection",".","The","object","detection","task","needs","the","following","information",":","-","images",".","-","ground","truth",",","rectangular","bounding","boxes","with","associated","labels",".","For","implementing","a","subclass","of","object","detection",",","one","needs","to","implement","the","following","methods",":","-","__init__","-","get_total","-","get_classes","-","iterate","Optionally",":","-","pretty_name","Additionally",",","must","use","the","`","_per_class_counter","`","variable","to","honor","the","max","number","of","examples","per","class","in","an","efficient","way","."]
docstr: Args:
      - only_classes: string or list of strings used as a class
          whitelist.
      - only_images: string or list of strings used as a image_id
          whitelist.
      - limit_examples: max number of examples (images) to use.
      - class_examples: finish when every class has this approximate
          number of examples.
docstr_tok: ["Args",":","-","only_classes",":","string","or","list","of","strings","used","as","a","class","whitelist",".","-","only_images",":","string","or","list","of","strings","used","as","a","image_id","whitelist",".","-","limit_examples",":","max","number","of","examples","(","images",")","to","use",".","-","class_examples",":","finish","when","every","class","has","this","approximate","number","of","examples","."]
code: def __init__(
      self,
      only_classes=None,
      only_images=None,
      limit_examples=None,
      class_examples=None,
      **kwargs,
  ):
      """
      Args:
          - only_classes: string or list of strings used as a class
              whitelist.
          - only_images: string or list of strings used as a image_id
              whitelist.
          - limit_examples: max number of examples (images) to use.
          - class_examples: finish when every class has this approximate
              number of examples.
      """
      super(ObjectDetectionReader, self).__init__()
      if isinstance(only_classes, six.string_types):
          # We can get one class as string.
          only_classes = only_classes.split(",")
      self._only_classes = only_classes
  
      if isinstance(only_images, six.string_types):
          # We can get one class as string.
          only_images = only_images.split(",")
      self._only_images = only_images
  
      self._total = None
      self._classes = None
  
      self._limit_examples = limit_examples
      self._class_examples = class_examples
      self._per_class_counter = Counter()
      self._maxed_out_classes = set()
  
imports: import abc
  import six
  import tensorflow
  from collections import Counter
  from luminoth.tools.dataset.readers import BaseReader
label_desc: Use image node_id 1 to create a new ObjectDetectionReader object from inherited base classes: BaseReader with example: obj = ObjectDetectionReader(only_classes, only_images, limit_examples, class_examples)