class_docstr: Abstract class to postprocess the raw output of the model
  
  Args:
  ----
      box_thresh (float): minimal objectness score to consider a box
      bin_thresh (float): threshold to apply to segmentation raw heatmap
      assume straight_pages (bool): if True, fit straight boxes only
class_docstr_tok: ["Abstract","class","to","postprocess","the","raw","output","of","the","model","Args",":","--","--","box_thresh","(","float",")",":","minimal","objectness","score","to","consider","a","box","bin_thresh","(","float",")",":","threshold","to","apply","to","segmentation","raw","heatmap","assume","straight_pages","(","bool",")",":","if","True",",","fit","straight","boxes","only"]
docstr: Performs postprocessing for a list of model outputs
  
  Args:
  ----
      proba_map: probability map of shape (N, H, W, C)
  
  Returns:
  -------
      list of N class predictions (for each input sample), where each class predictions is a list of C tensors
  of shape (*, 5) or (*, 6)
docstr_tok: ["Performs","postprocessing","for","a","list","of","model","outputs","Args",":","--","--","proba_map",":","probability","map","of","shape","(","N",",","H",",","W",",","C",")","Returns",":","--","--","--","-","list","of","N","class","predictions","(","for","each","input","sample",")",",","where","each","class","predictions","is","a","list","of","C","tensors","of","shape","(","*",",","5",")","or","(","*",",","6",")"]
code: def __call__(
      self,
      proba_map,
  ) -> List[List[np.ndarray]]:
      """Performs postprocessing for a list of model outputs
  
      Args:
      ----
          proba_map: probability map of shape (N, H, W, C)
  
      Returns:
      -------
          list of N class predictions (for each input sample), where each class predictions is a list of C tensors
      of shape (*, 5) or (*, 6)
      """
      if proba_map.ndim != 4:
          raise AssertionError(
              f"arg `proba_map` is expected to be 4-dimensional, got {proba_map.ndim}."
          )
  
      # Erosion + dilation on the binary map
      bin_map = [
          [
              cv2.morphologyEx(
                  bmap[..., idx], cv2.MORPH_OPEN, self._opening_kernel
              )
              for idx in range(proba_map.shape[-1])
          ]
          for bmap in (proba_map >= self.bin_thresh).astype(np.uint8)
      ]
  
      return [
          [
              self.bitmap_to_boxes(pmaps[..., idx], bmaps[idx])
              for idx in range(proba_map.shape[-1])
          ]
          for pmaps, bmaps in zip(proba_map, bin_map)
      ]
  
file_path: doctr/doctr/models/detection/core.py
imports: from typing import List
  import cv2
  import numpy
  from doctr.utils.repr import NestedObject
label_desc: Use image node_id 5 for calling the DetectionPostProcessor obj's underlying member method code with example usage: obj.__call__(proba_map) and returns: unknown