'Add detected result of a single image into the evaluation database.
Args:
image_key: sha256 key of image content
detected_boxes: A numpy array of shape [N, 4] representing detected box
coordinates[y_min, x_min, y_max, x_max]
detected_scores: A 1-d numpy array of length N representing classification
score
detected_class_labels: A 1-d numpy array of length N representing class
labels
Raises:
ValueError: if detected_boxes, detected_scores and detected_class_labels
do not have the same length.'

def add_single_detected_image_info(self, image_key, detected_boxes, detected_scores, detected_class_labels):

    if ((len(detected_boxes) != len(detected_scores)) or (len(detected_boxes) != len(detected_class_labels))):
        raise ValueError(('detected_boxes,    detected_scores    and    detected_class_labels    should    all    have    same    lengths.    Got[%d,    %d,    %d]' % len(detected_boxes)), len(detected_scores), len(detected_class_labels))
    if (image_key in self.detection_keys):
        logging.warn('image    %s    has    already    been    added    to    the    detection    result    database', image_key)
        return
    self.detection_keys.add(image_key)
    if (image_key in self.groundtruth_boxes):
        groundtruth_boxes = self.groundtruth_boxes[image_key]
        groundtruth_class_labels = self.groundtruth_class_labels[image_key]
        groundtruth_is_difficult_list = self.groundtruth_is_difficult_list[image_key]
    else:
        groundtruth_boxes = np.empty(shape=[0, 4], dtype=float)
        groundtruth_class_labels = np.array([], dtype=int)
        groundtruth_is_difficult_list = np.array([], dtype=bool)
    (scores, tp_fp_labels, is_class_correctly_detected_in_image) = self.per_image_eval.compute_object_detection_metrics(detected_boxes, detected_scores, detected_class_labels, groundtruth_boxes, groundtruth_class_labels, groundtruth_is_difficult_list)
    for i in range(self.num_class):
        self.scores_per_class[i].append(scores[i])
        self.tp_fp_labels_per_class[i].append(tp_fp_labels[i])
    self.num_images_correctly_detected_per_class += is_class_correctly_detected_in_image
