'Compute CorLoc score for a single class.
Args:
detected_boxes: A numpy array of shape [N, 4] representing detected box
coordinates
detected_scores: A 1-d numpy array of length N representing classification
score
groundtruth_boxes: A numpy array of shape [M, 4] representing ground truth
box coordinates
Returns:
is_class_correctly_detected_in_image: An integer 1 or 0 denoting whether a
class is correctly detected in the image or not'

def _compute_is_aclass_correctly_detected_in_image(self, detected_boxes, detected_scores, groundtruth_boxes):

    if (detected_boxes.size > 0):
        if (groundtruth_boxes.size > 0):
            max_score_id = np.argmax(detected_scores)
            detected_boxlist = np_box_list.BoxList(np.expand_dims(detected_boxes[max_score_id, :], axis=0))
            gt_boxlist = np_box_list.BoxList(groundtruth_boxes)
            iou = np_box_list_ops.iou(detected_boxlist, gt_boxlist)
            if (np.max(iou) >= self.matching_iou_threshold):
                return 1
    return 0
