class_docstr: Metric of separated and occluded masks which presented in paper `A Tri-
  Layer Plugin to Improve Occluded Detection.
  
  <https://arxiv.org/abs/2210.10046>`_.
  
  Separated COCO and Occluded COCO are automatically generated subsets of
  COCO val dataset, collecting separated objects and partially occluded
  objects for a large variety of categories. In this way, we define
  occlusion into two major categories: separated and partially occluded.
  
  - Separation: target object segmentation mask is separated into distinct
    regions by the occluder.
  - Partial Occlusion: target object is partially occluded but the
    segmentation mask is connected.
  
  These two new scalable real-image datasets are to benchmark a model's
  capability to detect occluded objects of 80 common categories.
  
  Please cite the paper if you use this dataset:
  
  @article{zhan2022triocc,
      title={A Tri-Layer Plugin to Improve Occluded Detection},
      author={Zhan, Guanqi and Xie, Weidi and Zisserman, Andrew},
      journal={British Machine Vision Conference},
      year={2022}
  }
  
  Args:
      occluded_ann (str): Path to the occluded coco annotation file.
      separated_ann (str): Path to the separated coco annotation file.
      score_thr (float): Score threshold of the detection masks.
          Defaults to 0.3.
      iou_thr (float): IoU threshold for the recall calculation.
          Defaults to 0.75.
      metric (str | List[str]): Metrics to be evaluated. Valid metrics
          include 'bbox', 'segm', 'proposal', and 'proposal_fast'.
          Defaults to 'bbox'.
docstr: Compute the recall of occluded or separated masks.
  
  Args:
      result_dict (dict): Processed mask results.
      gt_ann (list): Occluded or separated coco annotations.
      is_occ (bool): Whether the annotation is occluded mask.
          Defaults to True.
  Returns:
      tuple: number of correct masks and the recall.
docstr_tok: ["Compute","the","recall","of","occluded","or","separated","masks",".","Args",":","result_dict","(","dict",")",":","Processed","mask","results",".","gt_ann","(","list",")",":","Occluded","or","separated","coco","annotations",".","is_occ","(","bool",")",":","Whether","the","annotation","is","occluded","mask",".","Defaults","to","True",".","Returns",":","tuple",":","number","of","correct","masks","and","the","recall","."]
code: def compute_recall(
      self, result_dict: dict, gt_ann: list, is_occ: bool = True
  ) -> tuple:
      """Compute the recall of occluded or separated masks.
  
      Args:
          result_dict (dict): Processed mask results.
          gt_ann (list): Occluded or separated coco annotations.
          is_occ (bool): Whether the annotation is occluded mask.
              Defaults to True.
      Returns:
          tuple: number of correct masks and the recall.
      """
      correct = 0
      prog_bar = mmengine.ProgressBar(len(gt_ann))
      for iter_i in range(len(gt_ann)):
          cur_item = gt_ann[iter_i]
          cur_img_name = cur_item[0]
          cur_gt_bbox = cur_item[3]
          if is_occ:
              cur_gt_bbox = [
                  cur_gt_bbox[0],
                  cur_gt_bbox[1],
                  cur_gt_bbox[0] + cur_gt_bbox[2],
                  cur_gt_bbox[1] + cur_gt_bbox[3],
              ]
          cur_gt_class = cur_item[1]
          cur_gt_mask = coco_mask.decode(cur_item[4])
  
          assert cur_img_name in result_dict.keys()
          cur_detections = result_dict[cur_img_name]
  
          correct_flag = False
          for i in range(len(cur_detections)):
              cur_det_confidence = cur_detections[i][0]
              if cur_det_confidence < self.score_thr:
                  break
              cur_det_class = cur_detections[i][1]
              if cur_det_class != cur_gt_class:
                  continue
              cur_det_mask = cur_detections[i][2]
              cur_iou = self.mask_iou(cur_det_mask, cur_gt_mask)
              if cur_iou >= self.iou_thr:
                  correct_flag = True
                  break
          if correct_flag:
              correct += 1
          prog_bar.update()
      recall = correct / len(gt_ann) * 100
      return correct, recall
  
file_path: mmdetection/mmdet/evaluation/metrics/coco_occluded_metric.py
imports: from typing import Dict, List, Optional, Union
  import mmengine
  import numpy
  from mmengine.fileio import load
  from mmengine.logging import print_log
  from pycocotools import mask
  from terminaltables import AsciiTable
  from mmdet.registry import METRICS
  from .coco_metric import CocoMetric
label_desc: Use image node_id 4 for calling the CocoOccludedSeparatedMetric obj's underlying member method code with example usage: obj.compute_recall(result_dict, gt_ann, is_occ) and returns: correct,  recall