class_docstr: Evaluate detection result of a single image.
class_docstr_tok: ["Evaluate","detection","result","of","a","single","image","."]
docstr: Evaluates detections as being tp, fp or ignored from a single image.
  
  The evaluation is done in two stages:
   1. All detections are matched to non group-of boxes; true positives are
      determined and detections matched to difficult boxes are ignored.
   2. Detections that are determined as false positives are matched against
      group-of boxes and ignored if matched.
  
  Args:
    detected_boxes: A float numpy array of shape [N, 4], representing N
        regions of detected object regions.
        Each row is of the format [y_min, x_min, y_max, x_max]
    detected_scores: A float numpy array of shape [N, 1], representing
        the confidence scores of the detected N object instances.
    detected_class_labels: A integer numpy array of shape [N, 1], repreneting
        the class labels of the detected N object instances.
    groundtruth_boxes: A float numpy array of shape [M, 4], representing M
        regions of object instances in ground truth
    groundtruth_class_labels: An integer numpy array of shape [M, 1],
        representing M class labels of object instances in ground truth
    groundtruth_is_difficult_list: A boolean numpy array of length M denoting
        whether a ground truth box is a difficult instance or not
    groundtruth_is_group_of_list: A boolean numpy array of length M denoting
        whether a ground truth box has group-of tag
    detected_masks: (optional) A uint8 numpy array of shape
      [N, height, width]. If not None, the metrics will be computed based
      on masks.
    groundtruth_masks: (optional) A uint8 numpy array of shape
      [M, height, width].
  
  Returns:
    scores: A list of C float numpy arrays. Each numpy array is of
        shape [K, 1], representing K scores detected with object class
        label c
    tp_fp_labels: A list of C boolean numpy arrays. Each numpy array
        is of shape [K, 1], representing K True/False positive label of
        object instances detected with class label c
docstr_tok: ["Evaluates","detections","as","being","tp",",","fp","or","ignored","from","a","single","image",".","The","evaluation","is","done","in","two","stages",":","1",".","All","detections","are","matched","to","non","group-of","boxes",";","true","positives","are","determined","and","detections","matched","to","difficult","boxes","are","ignored",".","2",".","Detections","that","are","determined","as","false","positives","are","matched","against","group-of","boxes","and","ignored","if","matched",".","Args",":","detected_boxes",":","A","float","numpy","array","of","shape","[","N",",","4","]",",","representing","N","regions","of","detected","object","regions",".","Each","row","is","of","the","format","[","y_min",",","x_min",",","y_max",",","x_max","]","detected_scores",":","A","float","numpy","array","of","shape","[","N",",","1","]",",","representing","the","confidence","scores","of","the","detected","N","object","instances",".","detected_class_labels",":","A","integer","numpy","array","of","shape","[","N",",","1","]",",","repreneting","the","class","labels","of","the","detected","N","object","instances",".","groundtruth_boxes",":","A","float","numpy","array","of","shape","[","M",",","4","]",",","representing","M","regions","of","object","instances","in","ground","truth","groundtruth_class_labels",":","An","integer","numpy","array","of","shape","[","M",",","1","]",",","representing","M","class","labels","of","object","instances","in","ground","truth","groundtruth_is_difficult_list",":","A","boolean","numpy","array","of","length","M","denoting","whether","a","ground","truth","box","is","a","difficult","instance","or","not","groundtruth_is_group_of_list",":","A","boolean","numpy","array","of","length","M","denoting","whether","a","ground","truth","box","has","group-of","tag","detected_masks",":","(","optional",")","A","uint8","numpy","array","of","shape","[","N",",","height",",","width","]",".","If","not","None",",","the","metrics","will","be","computed","based","on","masks",".","groundtruth_masks",":","(","optional",")","A","uint8","numpy","array","of","shape","[","M",",","height",",","width","]",".","Returns",":","scores",":","A","list","of","C","float","numpy","arrays",".","Each","numpy","array","is","of","shape","[","K",",","1","]",",","representing","K","scores","detected","with","object","class","label","c","tp_fp_labels",":","A","list","of","C","boolean","numpy","arrays",".","Each","numpy","array","is","of","shape","[","K",",","1","]",",","representing","K","True\/False","positive","label","of","object","instances","detected","with","class","label","c"]
code: def compute_object_detection_metrics(
      self,
      detected_boxes,
      detected_scores,
      detected_class_labels,
      groundtruth_boxes,
      groundtruth_class_labels,
      groundtruth_is_difficult_list,
      groundtruth_is_group_of_list,
      detected_masks=None,
      groundtruth_masks=None,
  ):
      """Evaluates detections as being tp, fp or ignored from a single image.
  
      The evaluation is done in two stages:
       1. All detections are matched to non group-of boxes; true positives are
          determined and detections matched to difficult boxes are ignored.
       2. Detections that are determined as false positives are matched against
          group-of boxes and ignored if matched.
  
      Args:
        detected_boxes: A float numpy array of shape [N, 4], representing N
            regions of detected object regions.
            Each row is of the format [y_min, x_min, y_max, x_max]
        detected_scores: A float numpy array of shape [N, 1], representing
            the confidence scores of the detected N object instances.
        detected_class_labels: A integer numpy array of shape [N, 1], repreneting
            the class labels of the detected N object instances.
        groundtruth_boxes: A float numpy array of shape [M, 4], representing M
            regions of object instances in ground truth
        groundtruth_class_labels: An integer numpy array of shape [M, 1],
            representing M class labels of object instances in ground truth
        groundtruth_is_difficult_list: A boolean numpy array of length M denoting
            whether a ground truth box is a difficult instance or not
        groundtruth_is_group_of_list: A boolean numpy array of length M denoting
            whether a ground truth box has group-of tag
        detected_masks: (optional) A uint8 numpy array of shape
          [N, height, width]. If not None, the metrics will be computed based
          on masks.
        groundtruth_masks: (optional) A uint8 numpy array of shape
          [M, height, width].
  
      Returns:
        scores: A list of C float numpy arrays. Each numpy array is of
            shape [K, 1], representing K scores detected with object class
            label c
        tp_fp_labels: A list of C boolean numpy arrays. Each numpy array
            is of shape [K, 1], representing K True/False positive label of
            object instances detected with class label c
      """
      (
          detected_boxes,
          detected_scores,
          detected_class_labels,
          detected_masks,
      ) = self._remove_invalid_boxes(
          detected_boxes,
          detected_scores,
          detected_class_labels,
          detected_masks,
      )
      scores, tp_fp_labels = self._compute_tp_fp(
          detected_boxes=detected_boxes,
          detected_scores=detected_scores,
          detected_class_labels=detected_class_labels,
          groundtruth_boxes=groundtruth_boxes,
          groundtruth_class_labels=groundtruth_class_labels,
          groundtruth_is_difficult_list=groundtruth_is_difficult_list,
          groundtruth_is_group_of_list=groundtruth_is_group_of_list,
          detected_masks=detected_masks,
          groundtruth_masks=groundtruth_masks,
      )
  
      return scores, tp_fp_labels
  
file_path: SlowFast/ava_evaluation/per_image_evaluation.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import numpy
  from .None import np_box_list, np_box_list_ops, np_box_mask_list, np_box_mask_list_ops
label_desc: Use image node_id 2 for calling the PerImageEvaluation obj's underlying member method code with example usage: obj.compute_object_detection_metrics(detected_boxes, detected_scores, detected_class_labels, groundtruth_boxes, groundtruth_class_labels, groundtruth_is_difficult_list, groundtruth_is_group_of_list, detected_masks, groundtruth_masks) and returns: scores,  tp_fp_labels