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: We need to resize image and bounding boxes when the biggest side
  dimension is bigger than `self._image_max_size` or when the smaller
  side is smaller than `self._image_min_size`.
  
  Then, using the ratio we used, we need to properly scale the bounding
  boxes.
  
  Args:
      image: Tensor with image of shape (H, W, 3).
      bboxes: Tensor with bounding boxes with shape (num_bboxes, 5).
          where we have (x_min, y_min, x_max, y_max, label) for each one.
  
  Returns:
      image: Tensor with scaled image.
      bboxes: Tensor with scaled (using the same factor as the image)
          bounding boxes with shape (num_bboxes, 5).
      scale_factor: Scale factor used to modify the image (1.0 means no
          change).
docstr_tok: ["We","need","to","resize","image","and","bounding","boxes","when","the","biggest","side","dimension","is","bigger","than","`","self._image_max_size","`","or","when","the","smaller","side","is","smaller","than","`","self._image_min_size","`",".","Then",",","using","the","ratio","we","used",",","we","need","to","properly","scale","the","bounding","boxes",".","Args",":","image",":","Tensor","with","image","of","shape","(","H",",","W",",","3",")",".","bboxes",":","Tensor","with","bounding","boxes","with","shape","(","num_bboxes",",","5",")",".","where","we","have","(","x_min",",","y_min",",","x_max",",","y_max",",","label",")","for","each","one",".","Returns",":","image",":","Tensor","with","scaled","image",".","bboxes",":","Tensor","with","scaled","(","using","the","same","factor","as","the","image",")","bounding","boxes","with","shape","(","num_bboxes",",","5",")",".","scale_factor",":","Scale","factor","used","to","modify","the","image","(","1.0","means","no","change",")","."]
code: def _resize_image(self, image, bboxes=None):
      """
      We need to resize image and bounding boxes when the biggest side
      dimension is bigger than `self._image_max_size` or when the smaller
      side is smaller than `self._image_min_size`.
  
      Then, using the ratio we used, we need to properly scale the bounding
      boxes.
  
      Args:
          image: Tensor with image of shape (H, W, 3).
          bboxes: Tensor with bounding boxes with shape (num_bboxes, 5).
              where we have (x_min, y_min, x_max, y_max, label) for each one.
  
      Returns:
          image: Tensor with scaled image.
          bboxes: Tensor with scaled (using the same factor as the image)
              bounding boxes with shape (num_bboxes, 5).
          scale_factor: Scale factor used to modify the image (1.0 means no
              change).
      """
      if self._fixed_resize:
          resized = resize_image_fixed(
              image,
              self._image_fixed_height,
              self._image_fixed_width,
              bboxes=bboxes,
          )
      else:
          resized = resize_image(
              image,
              bboxes=bboxes,
              min_size=self._image_min_size,
              max_size=self._image_max_size,
          )
  
      return (
          resized["image"],
          resized.get("bboxes"),
          resized["scale_factor"],
      )
  
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 5 for calling the ObjectDetectionDataset obj's underlying member method code with example usage: obj._resize_image(image, bboxes) and returns: resized,  resized,  resized