class_docstr: Merge augmented detection results, only bboxes corresponding score under
  flipping and multi-scale resizing can be processed now.
  
  Examples:
      >>> tta_model = dict(
      >>>     type='DetTTAModel',
      >>>     tta_cfg=dict(nms=dict(
      >>>                     type='nms',
      >>>                     iou_threshold=0.5),
      >>>                     max_per_img=100))
      >>>
      >>> tta_pipeline = [
      >>>     dict(type='LoadImageFromFile',
      >>>          backend_args=None),
      >>>     dict(
      >>>         type='TestTimeAug',
      >>>         transforms=[[
      >>>             dict(type='Resize',
      >>>                  scale=(1333, 800),
      >>>                  keep_ratio=True),
      >>>         ], [
      >>>             dict(type='RandomFlip', prob=1.),
      >>>             dict(type='RandomFlip', prob=0.)
      >>>         ], [
      >>>             dict(
      >>>                 type='PackDetInputs',
      >>>                 meta_keys=('img_id', 'img_path', 'ori_shape',
      >>>                         'img_shape', 'scale_factor', 'flip',
      >>>                         'flip_direction'))
      >>>         ]])]
class_docstr_tok: ["Merge","augmented","detection","results",",","only","bboxes","corresponding","score","under","flipping","and","multi-scale","resizing","can","be","processed","now",".","Examples",":",">",">",">","tta_model","=","dict","(",">",">",">","type='DetTTAModel","'",",",">",">",">","tta_cfg=dict","(","nms=dict","(",">",">",">","type='nms","'",",",">",">",">","iou_threshold=0.5",")",",",">",">",">","max_per_img=100",")",")",">",">",">",">",">",">","tta_pipeline","=","[",">",">",">","dict","(","type='LoadImageFromFile","'",",",">",">",">","backend_args=None",")",",",">",">",">","dict","(",">",">",">","type='TestTimeAug","'",",",">",">",">","transforms=","[","[",">",">",">","dict","(","type='Resize","'",",",">",">",">","scale=","(","1333",",","800",")",",",">",">",">","keep_ratio=True",")",",",">",">",">","]",",","[",">",">",">","dict","(","type='RandomFlip","'",",","prob=1",".",")",",",">",">",">","dict","(","type='RandomFlip","'",",","prob=0",".",")",">",">",">","]",",","[",">",">",">","dict","(",">",">",">","type='PackDetInputs","'",",",">",">",">","meta_keys=","(","'img_id","'",",","'img_path","'",",","'ori_shape","'",",",">",">",">","'img_shape","'",",","'scale_factor","'",",","'flip","'",",",">",">",">","'flip_direction","'",")",")",">",">",">","]","]",")","]"]
docstr: Merge batch predictions of enhanced data.
  
  Args:
      data_samples_list (List[List[DetDataSample]]): List of predictions
          of all enhanced data. The outer list indicates images, and the
          inner list corresponds to the different views of one image.
          Each element of the inner list is a ``DetDataSample``.
  Returns:
      List[DetDataSample]: Merged batch prediction.
docstr_tok: ["Merge","batch","predictions","of","enhanced","data",".","Args",":","data_samples_list","(","List","[","List","[","DetDataSample","]","]",")",":","List","of","predictions","of","all","enhanced","data",".","The","outer","list","indicates","images",",","and","the","inner","list","corresponds","to","the","different","views","of","one","image",".","Each","element","of","the","inner","list","is","a","``","DetDataSample","``",".","Returns",":","List","[","DetDataSample","]",":","Merged","batch","prediction","."]
code: def merge_preds(self, data_samples_list: List[List[DetDataSample]]):
      """Merge batch predictions of enhanced data.
  
      Args:
          data_samples_list (List[List[DetDataSample]]): List of predictions
              of all enhanced data. The outer list indicates images, and the
              inner list corresponds to the different views of one image.
              Each element of the inner list is a ``DetDataSample``.
      Returns:
          List[DetDataSample]: Merged batch prediction.
      """
      merged_data_samples = []
      for data_samples in data_samples_list:
          merged_data_samples.append(
              self._merge_single_sample(data_samples)
          )
      return merged_data_samples
  
file_path: mmdetection/mmdet/models/test_time_augs/det_tta.py
imports: from typing import List, Tuple
  import torch
  from mmcv.ops import batched_nms
  from mmengine.model import BaseTTAModel
  from mmengine.registry import MODELS
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.structures import DetDataSample
  from mmdet.structures.bbox import bbox_flip
label_desc: Use image node_id 3 for calling the DetTTAModel obj's underlying member method code with example usage: obj.merge_preds(data_samples_list) and returns: merged_data_samples