'Return the database of ground-truth regions of interest.
This function loads/saves from/to a cache file to speed up future calls.'

def gt_roidb(self):

    cache_file = os.path.join(self.cache_path, (((self.name + '_') + cfg.SUBCLS_NAME) + '_gt_roidb.pkl'))
    if os.path.exists(cache_file):
        with open(cache_file, 'rb') as fid:
            roidb = cPickle.load(fid)
        print '{}    gt    roidb    loaded    from    {}'.format(self.name, cache_file)
        return roidb
    gt_roidb = [self._load_imagenet3d_annotation(index) for index in self.image_index]
    if cfg.IS_RPN:
        for i in xrange(1, self.num_classes):
            print '{}:    Total    number    of    boxes    {:d}'.format(self.classes[i], self._num_boxes_all[i])
            print '{}:    Number    of    boxes    covered    {:d}'.format(self.classes[i], self._num_boxes_covered[i])
            print '{}:    Recall    {:f}'.format(self.classes[i], (float(self._num_boxes_covered[i]) / float(self._num_boxes_all[i])))
    with open(cache_file, 'wb') as fid:
        cPickle.dump(gt_roidb, fid, cPickle.HIGHEST_PROTOCOL)
    print 'wrote    gt    roidb    to    {}'.format(cache_file)
    return gt_roidb
