class_docstr: Base class for detectors.
  
  Args:
     data_preprocessor (dict or ConfigDict, optional): The pre-process
         config of :class:`BaseDataPreprocessor`.  it usually includes,
          ``pad_size_divisor``, ``pad_value``, ``mean`` and ``std``.
     init_cfg (dict or ConfigDict, optional): the config to control the
         initialization. Defaults to None.
class_docstr_tok: ["Base","class","for","detectors",".","Args",":","data_preprocessor","(","dict","or","ConfigDict",",","optional",")",":","The","pre-process","config","of",":","class",":","`","BaseDataPreprocessor","`",".","it","usually","includes",",","``","pad_size_divisor","``",",","``","pad_value","``",",","``","mean","``","and","``","std","``",".","init_cfg","(","dict","or","ConfigDict",",","optional",")",":","the","config","to","control","the","initialization",".","Defaults","to","None","."]
docstr: Add predictions to `DetDataSample`.
  
  Args:
      data_samples (list[:obj:`DetDataSample`], optional): A batch of
          data samples that contain annotations and predictions.
      results_list (list[:obj:`InstanceData`]): Detection results of
          each image.
  
  Returns:
      list[:obj:`DetDataSample`]: Detection results of the
      input images. Each DetDataSample usually contain
      'pred_instances'. And the ``pred_instances`` usually
      contains following keys.
  
          - scores (Tensor): Classification scores, has a shape
              (num_instance, )
          - labels (Tensor): Labels of bboxes, has a shape
              (num_instances, ).
          - bboxes (Tensor): Has a shape (num_instances, 4),
              the last dimension 4 arrange as (x1, y1, x2, y2).
docstr_tok: ["Add","predictions","to","`","DetDataSample","`",".","Args",":","data_samples","(","list","[",":","obj",":","`","DetDataSample","`","]",",","optional",")",":","A","batch","of","data","samples","that","contain","annotations","and","predictions",".","results_list","(","list","[",":","obj",":","`","InstanceData","`","]",")",":","Detection","results","of","each","image",".","Returns",":","list","[",":","obj",":","`","DetDataSample","`","]",":","Detection","results","of","the","input","images",".","Each","DetDataSample","usually","contain","'pred_instances","'",".","And","the","``","pred_instances","``","usually","contains","following","keys",".","-","scores","(","Tensor",")",":","Classification","scores",",","has","a","shape","(","num_instance",",",")","-","labels","(","Tensor",")",":","Labels","of","bboxes",",","has","a","shape","(","num_instances",",",")",".","-","bboxes","(","Tensor",")",":","Has","a","shape","(","num_instances",",","4",")",",","the","last","dimension","4","arrange","as","(","x1",",","y1",",","x2",",","y2",")","."]
code: def add_pred_to_datasample(
      self, data_samples: SampleList, results_list: InstanceList
  ) -> SampleList:
      """Add predictions to `DetDataSample`.
  
      Args:
          data_samples (list[:obj:`DetDataSample`], optional): A batch of
              data samples that contain annotations and predictions.
          results_list (list[:obj:`InstanceData`]): Detection results of
              each image.
  
      Returns:
          list[:obj:`DetDataSample`]: Detection results of the
          input images. Each DetDataSample usually contain
          'pred_instances'. And the ``pred_instances`` usually
          contains following keys.
  
              - scores (Tensor): Classification scores, has a shape
                  (num_instance, )
              - labels (Tensor): Labels of bboxes, has a shape
                  (num_instances, ).
              - bboxes (Tensor): Has a shape (num_instances, 4),
                  the last dimension 4 arrange as (x1, y1, x2, y2).
      """
      for data_sample, pred_instances in zip(
          data_samples, results_list
      ):
          data_sample.pred_instances = pred_instances
      samplelist_boxtype2tensor(data_samples)
      return data_samples
  
imports: from abc import ABCMeta, abstractmethod
  from typing import Dict, List, Tuple, Union
  import torch
  from mmengine.model import BaseModel
  from torch import Tensor
  from mmdet.structures import DetDataSample, OptSampleList, SampleList
  from mmdet.utils import InstanceList, OptConfigType, OptMultiConfig
  from ..utils import samplelist_boxtype2tensor
label_desc: Use image node_id 11 for calling the BaseDetector obj's underlying member method code with example usage: obj.add_pred_to_datasample(data_samples, results_list) and returns: data_samples