class_docstr: Base class for CUB dataset.
  
      
class_docstr_tok: ["Base","class","for","CUB","dataset","."]
code: def __init__(self, data_dir="auto", prob_map_dir="auto"):
      super(CUBDatasetBase, self).__init__()
  
      if data_dir == "auto":
          data_dir = get_cub()
      if prob_map_dir == "auto":
          prob_map_dir = get_cub_prob_map()
      self.data_dir = data_dir
      self.prob_map_dir = prob_map_dir
  
      imgs_file = os.path.join(data_dir, "images.txt")
      bbs_file = os.path.join(data_dir, "bounding_boxes.txt")
  
      self.paths = [line.strip().split()[1] for line in open(imgs_file)]
  
      # (x_min, y_min, width, height)
      bbs = np.array(
          [
              tuple(map(float, line.split()[1:5]))
              for line in open(bbs_file)
          ]
      )
      # (x_min, y_min, width, height) -> (x_min, y_min, x_max, y_max)
      bbs[:, 2:] += bbs[:, :2]
      # (x_min, y_min, width, height) -> (y_min, x_min, y_max, x_max)
      bbs[:] = bbs[:, [1, 0, 3, 2]]
      self.bbs = bbs.astype(np.float32)
  
      self.prob_map_paths = [
          os.path.join(
              self.prob_map_dir, os.path.splitext(path)[0] + ".png"
          )
          for path in self.paths
      ]
  
      self.add_getter("bbox", self._get_bbox)
      self.add_getter("prob_map", self._get_prob_map)
  
file_path: chainercv/chainercv/datasets/cub/cub_utils.py
imports: import filelock
  import numpy
  import os
  from chainer.dataset import download
  from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
  from chainercv import utils
label_desc: Use image node_id 1 to create a new CUBDatasetBase object from inherited base classes: GetterDataset with example: obj = CUBDatasetBase(data_dir, prob_map_dir)