class_docstr: Abstract object detector dataset module.
  
  This module implements some of the basic functionalities every object
  detector dataset usually needs.
  
  Object detection datasets are datasets that have ground-truth information
  consisting of rectangular bounding boxes.
  
  Attributes:
      dataset_dir (str): Base directory of the dataset.
      num_epochs (int): Number of epochs the dataset should iterate over.
      batch_size (int): Batch size the module should return.
      split (str): Split to consume the data from (usually "train", "val" or
          "test").
      image_min_size (int): Image minimum size, used for resizing images if
          needed.
      image_max_size (int): Image maximum size.
      random_shuffle (bool): To consume the dataset using random shuffle or
          to just use a regular FIFO queue.
docstr: Parse record TFRecord into a set a set of values, names and types
  that can be queued and then read.
  
  Returns:
      - queue_values: Dict with tensor values.
      - queue_names: Names for each tensor.
      - queue_types: Types for each tensor.
docstr_tok: ["Parse","record","TFRecord","into","a","set","a","set","of","values",",","names","and","types","that","can","be","queued","and","then","read",".","Returns",":","-","queue_values",":","Dict","with","tensor","values",".","-","queue_names",":","Names","for","each","tensor",".","-","queue_types",":","Types","for","each","tensor","."]
code: def read_record(self, record):
      """Parse record TFRecord into a set a set of values, names and types
      that can be queued and then read.
  
      Returns:
          - queue_values: Dict with tensor values.
          - queue_names: Names for each tensor.
          - queue_types: Types for each tensor.
      """
      # We parse variable length features (bboxes in a image) as sequence
      # features
      (
          context_example,
          sequence_example,
      ) = tf.parse_single_sequence_example(
          record,
          context_features=self.CONTEXT_FEATURES,
          sequence_features=self.SEQUENCE_FEATURES,
      )
  
      # Decode image
      image_raw = tf.image.decode_image(
          context_example["image_raw"], channels=3
      )
  
      image = tf.cast(image_raw, tf.float32)
  
      height = tf.cast(context_example["height"], tf.int32)
      width = tf.cast(context_example["width"], tf.int32)
      image_shape = tf.stack([height, width, 3])
      image = tf.reshape(image, image_shape)
  
      label = self._sparse_to_tensor(sequence_example["label"])
      xmin = self._sparse_to_tensor(sequence_example["xmin"])
      xmax = self._sparse_to_tensor(sequence_example["xmax"])
      ymin = self._sparse_to_tensor(sequence_example["ymin"])
      ymax = self._sparse_to_tensor(sequence_example["ymax"])
  
      # Stack parsed tensors to define bounding boxes of shape (num_boxes, 5)
      bboxes = tf.stack([xmin, ymin, xmax, ymax, label], axis=1)
  
      image, bboxes, preprocessing_details = self.preprocess(
          image, bboxes
      )
  
      filename = tf.cast(context_example["filename"], tf.string)
  
      # TODO: Send additional metadata through the queue (scale_factor,
      # applied_augmentations)
  
      queue_dtypes = [tf.float32, tf.int32, tf.string, tf.float32]
      queue_names = ["image", "bboxes", "filename", "scale_factor"]
      queue_values = {
          "image": image,
          "bboxes": bboxes,
          "filename": filename,
          "scale_factor": preprocessing_details["scale_factor"],
      }
  
      return queue_values, queue_dtypes, queue_names
  
file_path: luminoth/luminoth/datasets/object_detection_dataset.py
imports: import tensorflow
  from luminoth.datasets.base_dataset import BaseDataset
  from luminoth.utils.image import resize_image_fixed, resize_image, flip_image, random_patch, random_resize, random_distortion, expand
label_desc: Use image node_id 3 for calling the ObjectDetectionDataset obj's underlying member method code with example usage: obj.read_record(record) and returns: queue_values,  queue_dtypes,  queue_names