code: def compute_cor_loc(
      num_gt_imgs_per_class, num_images_correctly_detected_per_class
  ):
      """Compute CorLoc according to the definition in the following paper.
  
      https://www.robots.ox.ac.uk/~vgg/rg/papers/deselaers-eccv10.pdf
  
      Returns nans if there are no ground truth images for a class.
  
      Args:
        num_gt_imgs_per_class: 1D array, representing number of images containing
            at least one object instance of a particular class
        num_images_correctly_detected_per_class: 1D array, representing number of
            images that are correctly detected at least one object instance of a
            particular class
  
      Returns:
        corloc_per_class: A float numpy array represents the corloc score of each
          class
      """
      # Divide by zero expected for classes with no gt examples.
      with np.errstate(divide="ignore", invalid="ignore"):
          return np.where(
              num_gt_imgs_per_class == 0,
              np.nan,
              num_images_correctly_detected_per_class
              / num_gt_imgs_per_class,
          )
  
imports: from __future__ import division
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: compute_cor_loc(num_gt_imgs_per_class, num_images_correctly_detected_per_class) and returns: np