class_docstr: Mixin class for testing det bboxes via DenseHead.
class_docstr_tok: ["Mixin","class","for","testing","det","bboxes","via","DenseHead","."]
docstr: Merge augmented detection bboxes and scores.
  
  Args:
      aug_bboxes (list[Tensor]): shape (n, 4*#class)
      aug_scores (list[Tensor] or None): shape (n, #class)
      img_shapes (list[Tensor]): shape (3, ).
  
  Returns:
      tuple[Tensor]: ``bboxes`` with shape (n,4), where
      4 represent (tl_x, tl_y, br_x, br_y)
      and ``scores`` with shape (n,).
docstr_tok: ["Merge","augmented","detection","bboxes","and","scores",".","Args",":","aug_bboxes","(","list","[","Tensor","]",")",":","shape","(","n",",","4","*","#","class",")","aug_scores","(","list","[","Tensor","]","or","None",")",":","shape","(","n",",","#","class",")","img_shapes","(","list","[","Tensor","]",")",":","shape","(","3",",",")",".","Returns",":","tuple","[","Tensor","]",":","``","bboxes","``","with","shape","(","n,4",")",",","where","4","represent","(","tl_x",",","tl_y",",","br_x",",","br_y",")","and","``","scores","``","with","shape","(","n",",",")","."]
code: def merge_aug_bboxes(self, aug_bboxes, aug_scores, img_metas):
      """Merge augmented detection bboxes and scores.
  
      Args:
          aug_bboxes (list[Tensor]): shape (n, 4*#class)
          aug_scores (list[Tensor] or None): shape (n, #class)
          img_shapes (list[Tensor]): shape (3, ).
  
      Returns:
          tuple[Tensor]: ``bboxes`` with shape (n,4), where
          4 represent (tl_x, tl_y, br_x, br_y)
          and ``scores`` with shape (n,).
      """
      recovered_bboxes = []
      for bboxes, img_info in zip(aug_bboxes, img_metas):
          img_shape = img_info[0]["img_shape"]
          scale_factor = img_info[0]["scale_factor"]
          flip = img_info[0]["flip"]
          flip_direction = img_info[0]["flip_direction"]
          bboxes = bbox_mapping_back(
              bboxes, img_shape, scale_factor, flip, flip_direction
          )
          recovered_bboxes.append(bboxes)
      bboxes = torch.cat(recovered_bboxes, dim=0)
      if aug_scores is None:
          return bboxes
      else:
          scores = torch.cat(aug_scores, dim=0)
          return bboxes, scores
  
file_path: mmdetection/mmdet/models/dense_heads/dense_test_mixins.py
imports: import sys
  import warnings
  from inspect import signature
  import torch
  from mmcv.ops import batched_nms
  from mmengine.structures import InstanceData
  from mmdet.structures.bbox import bbox_mapping_back
  from ..test_time_augs import merge_aug_proposals
label_desc: Use image node_id 4 for calling the BBoxTestMixin obj's underlying member method code with example usage: obj.merge_aug_bboxes(aug_bboxes, aug_scores, img_metas) and returns: bboxes, bboxes,  scores