class_docstr: Image database.
class_docstr_tok: ["Image","database","."]
code: def evaluate_recall(self, candidate_boxes, ar_thresh=0.5):
      # Record max overlap value for each gt box
      # Return vector of overlap values
      gt_overlaps = np.zeros(0)
      for i in range(self.num_images):
          gt_inds = np.where(self.roidb[i]["gt_classes"] > 0)[0]
          gt_boxes = self.roidb[i]["boxes"][gt_inds, :]
  
          boxes = candidate_boxes[i]
          if boxes.shape[0] == 0:
              continue
          overlaps = bbox_overlaps(
              boxes.astype(np.float), gt_boxes.astype(np.float)
          )
  
          # gt_overlaps = np.hstack((gt_overlaps, overlaps.max(axis=0)))
          _gt_overlaps = np.zeros((gt_boxes.shape[0]))
          for j in range(gt_boxes.shape[0]):
              argmax_overlaps = overlaps.argmax(axis=0)
              max_overlaps = overlaps.max(axis=0)
              gt_ind = max_overlaps.argmax()
              gt_ovr = max_overlaps.max()
              assert gt_ovr >= 0
              box_ind = argmax_overlaps[gt_ind]
              _gt_overlaps[j] = overlaps[box_ind, gt_ind]
              assert _gt_overlaps[j] == gt_ovr
              overlaps[box_ind, :] = -1
              overlaps[:, gt_ind] = -1
  
          gt_overlaps = np.hstack((gt_overlaps, _gt_overlaps))
  
      num_pos = gt_overlaps.size
      gt_overlaps = np.sort(gt_overlaps)
      step = 0.001
      thresholds = np.minimum(np.arange(0.5, 1.0 + step, step), 1.0)
      recalls = np.zeros_like(thresholds)
      for i, t in enumerate(thresholds):
          recalls[i] = (gt_overlaps >= t).sum() / float(num_pos)
      ar = 2 * np.trapz(recalls, thresholds)
  
      return ar, gt_overlaps, recalls, thresholds
  
imports: import os
  import os.path
  import PIL
  import numpy
  import scipy.sparse
  from builtins import range
  import sys
  from .utils.cython_bbox import bbox_overlaps
label_desc: Use image node_id 14 for calling the imdb obj's underlying member method code with example usage: obj.evaluate_recall(candidate_boxes, ar_thresh) and returns: ar,  gt_overlaps,  recalls,  thresholds