docstr: Return the database of selective search regions of interest.
  Ground-truth ROIs are also included.
  
  This function loads/saves from/to a cache file to speed up future calls.
docstr_tok: ["Return","the","database","of","selective","search","regions","of","interest",".","Ground-truth","ROIs","are","also","included",".","This","function","loads\/saves","from\/to","a","cache","file","to","speed","up","future","calls","."]
code: def selective_search_roidb(self):
      """
      Return the database of selective search regions of interest.
      Ground-truth ROIs are also included.
  
      This function loads/saves from/to a cache file to speed up future calls.
      """
      cache_file = os.path.join(
          self.cache_path, self.name + "_selective_search_roidb.pkl"
      )
  
      if os.path.exists(cache_file):
          with open(cache_file, "rb") as fid:
              roidb = cp.load(fid, encoding="latin1")
          print(
              "{} ss roidb loaded from {}".format(self.name, cache_file)
          )
          return roidb
  
      if int(self._year) == 2007 or not self._image_set.startswith(
          "test"
      ):
          gt_roidb = self.gt_roidb()
          ss_roidb = self._load_selective_search_roidb(gt_roidb)
          roidb = imdb.merge_roidbs(gt_roidb, ss_roidb)
      else:
          roidb = self._load_selective_search_roidb(None)
  
      # Keep max of e.g. 2000 rois
      if type(self._maxNrRois) == int:
          print("Only keep the first %d ROIs..." % self._maxNrRois)
          for i in range(self.num_images):
              gt_overlaps = roidb[i]["gt_overlaps"]
              gt_overlaps = gt_overlaps.todense()[: self._maxNrRois]
              gt_overlaps = scipy.sparse.csr_matrix(gt_overlaps)
              roidb[i]["boxes"] = roidb[i]["boxes"][
                  : self._maxNrRois, :
              ]
              roidb[i]["gt_classes"] = roidb[i]["gt_classes"][
                  : self._maxNrRois
              ]
              roidb[i]["gt_overlaps"] = roidb[i][
                  "gt_overlaps"
              ] = gt_overlaps
  
      with open(cache_file, "wb") as fid:
          cp.dump(roidb, fid, cp.HIGHEST_PROTOCOL)
      print("wrote ss roidb to {}".format(cache_file))
  
      return roidb
  
imports: from __future__ import print_function
  import os, pdb
  import xml.dom.minidom
  import numpy
  import scipy.sparse
  import scipy.io
  import pickle
  import subprocess
  from .imdb import imdb
  from .voc_eval import voc_eval
label_desc: Use image node_id 8 for calling the pascal_voc obj's underlying member method code with example usage: obj.selective_search_roidb() and returns: roidb, roidb