class_docstr: This code is based on
  https://github.com/fcjian/TOOD/blob/master/mmdet/models/dense_heads/tood_head.py
class_docstr_tok: ["This","code","is","based","on","https",":","\/\/github.com\/fcjian\/TOOD\/blob\/master\/mmdet\/models\/dense_heads\/tood_head.py"]
code: def post_process(self, head_outs, img_shape, scale_factor):
      pred_scores, pred_bboxes, _, _, _ = head_outs
      pred_scores = pred_scores.transpose([0, 2, 1])
  
      for i in range(len(pred_bboxes)):
          pred_bboxes[i, :, 0] = pred_bboxes[i, :, 0].clip(
              min=0, max=img_shape[i, 1]
          )
          pred_bboxes[i, :, 1] = pred_bboxes[i, :, 1].clip(
              min=0, max=img_shape[i, 0]
          )
          pred_bboxes[i, :, 2] = pred_bboxes[i, :, 2].clip(
              min=0, max=img_shape[i, 1]
          )
          pred_bboxes[i, :, 3] = pred_bboxes[i, :, 3].clip(
              min=0, max=img_shape[i, 0]
          )
      # scale bbox to origin
      scale_factor = scale_factor.flip([1]).tile([1, 2]).unsqueeze(1)
      pred_bboxes /= scale_factor
      bbox_pred, bbox_num, _ = self.nms(pred_bboxes, pred_scores)
      return bbox_pred, bbox_num
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddle import ParamAttr
  from paddle.nn.initializer import Constant
  from ppdet.core.workspace import register
  from ..initializer import normal_, constant_, bias_init_with_prob
  from ppdet.modeling.bbox_utils import bbox_center, batch_distance2bbox
  from ..losses import GIoULoss
  from ppdet.modeling.layers import ConvNormLayer
  from ppdet.modeling.ops import get_static_shape
  from ppdet.modeling.assigners.utils import generate_anchors_for_grid_cell
label_desc: Use image node_id 8 for calling the TOODHead obj's underlying member method code with example usage: obj.post_process(head_outs, img_shape, scale_factor) and returns: bbox_pred,  bbox_num