class_docstr: DataPreprocessor wrapper for multi-branch data.
  
  Take semi-supervised object detection as an example, assume that
  the ratio of labeled data and unlabeled data in a batch is 1:2,
  `sup` indicates the branch where the labeled data is augmented,
  `unsup_teacher` and `unsup_student` indicate the branches where
  the unlabeled data is augmented by different pipeline.
  
  The input format of multi-branch data is shown as below :
  
  .. code-block:: none
      {
          'inputs':
              {
                  'sup': [Tensor, None, None],
                  'unsup_teacher': [None, Tensor, Tensor],
                  'unsup_student': [None, Tensor, Tensor],
              },
          'data_sample':
              {
                  'sup': [DetDataSample, None, None],
                  'unsup_teacher': [None, DetDataSample, DetDataSample],
                  'unsup_student': [NOne, DetDataSample, DetDataSample],
              }
      }
  
  The format of multi-branch data
  after filtering None is shown as below :
  
  .. code-block:: none
      {
          'inputs':
              {
                  'sup': [Tensor],
                  'unsup_teacher': [Tensor, Tensor],
                  'unsup_student': [Tensor, Tensor],
              },
          'data_sample':
              {
                  'sup': [DetDataSample],
                  'unsup_teacher': [DetDataSample, DetDataSample],
                  'unsup_student': [DetDataSample, DetDataSample],
              }
      }
  
  In order to reuse `DetDataPreprocessor` for the data
  from different branches, the format of multi-branch data
  grouped by branch is as below :
  
  .. code-block:: none
      {
          'sup':
              {
                  'inputs': [Tensor]
                  'data_sample': [DetDataSample, DetDataSample]
              },
          'unsup_teacher':
              {
                  'inputs': [Tensor, Tensor]
                  'data_sample': [DetDataSample, DetDataSample]
              },
          'unsup_student':
              {
                  'inputs': [Tensor, Tensor]
                  'data_sample': [DetDataSample, DetDataSample]
              },
      }
  
  After preprocessing data from different branches,
  the multi-branch data needs to be reformatted as:
  
  .. code-block:: none
      {
          'inputs':
              {
                  'sup': [Tensor],
                  'unsup_teacher': [Tensor, Tensor],
                  'unsup_student': [Tensor, Tensor],
              },
          'data_sample':
              {
                  'sup': [DetDataSample],
                  'unsup_teacher': [DetDataSample, DetDataSample],
                  'unsup_student': [DetDataSample, DetDataSample],
              }
      }
  
  Args:
      data_preprocessor (:obj:`ConfigDict` or dict): Config of
          :class:`DetDataPreprocessor` to process the input data.
class_docstr_tok: ["DataPreprocessor","wrapper","for","multi-branch","data",".","Take","semi-supervised","object","detection","as","an","example",",","assume","that","the","ratio","of","labeled","data","and","unlabeled","data","in","a","batch","is","1:2",",","`","sup","`","indicates","the","branch","where","the","labeled","data","is","augmented",",","`","unsup_teacher","`","and","`","unsup_student","`","indicate","the","branches","where","the","unlabeled","data","is","augmented","by","different","pipeline",".","The","input","format","of","multi-branch","data","is","shown","as","below",":","..","code-block",":",":","none","{","'inputs","'",":","{","'sup","'",":","[","Tensor",",","None",",","None","]",",","'unsup_teacher","'",":","[","None",",","Tensor",",","Tensor","]",",","'unsup_student","'",":","[","None",",","Tensor",",","Tensor","]",",","}",",","'data_sample","'",":","{","'sup","'",":","[","DetDataSample",",","None",",","None","]",",","'unsup_teacher","'",":","[","None",",","DetDataSample",",","DetDataSample","]",",","'unsup_student","'",":","[","NOne",",","DetDataSample",",","DetDataSample","]",",","}","}","The","format","of","multi-branch","data","after","filtering","None","is","shown","as","below",":","..","code-block",":",":","none","{","'inputs","'",":","{","'sup","'",":","[","Tensor","]",",","'unsup_teacher","'",":","[","Tensor",",","Tensor","]",",","'unsup_student","'",":","[","Tensor",",","Tensor","]",",","}",",","'data_sample","'",":","{","'sup","'",":","[","DetDataSample","]",",","'unsup_teacher","'",":","[","DetDataSample",",","DetDataSample","]",",","'unsup_student","'",":","[","DetDataSample",",","DetDataSample","]",",","}","}","In","order","to","reuse","`","DetDataPreprocessor","`","for","the","data","from","different","branches",",","the","format","of","multi-branch","data","grouped","by","branch","is","as","below",":","..","code-block",":",":","none","{","'sup","'",":","{","'inputs","'",":","[","Tensor","]","'data_sample","'",":","[","DetDataSample",",","DetDataSample","]","}",",","'unsup_teacher","'",":","{","'inputs","'",":","[","Tensor",",","Tensor","]","'data_sample","'",":","[","DetDataSample",",","DetDataSample","]","}",",","'unsup_student","'",":","{","'inputs","'",":","[","Tensor",",","Tensor","]","'data_sample","'",":","[","DetDataSample",",","DetDataSample","]","}",",","}","After","preprocessing","data","from","different","branches",",","the","multi-branch","data","needs","to","be","reformatted","as",":","..","code-block",":",":","none","{","'inputs","'",":","{","'sup","'",":","[","Tensor","]",",","'unsup_teacher","'",":","[","Tensor",",","Tensor","]",",","'unsup_student","'",":","[","Tensor",",","Tensor","]",",","}",",","'data_sample","'",":","{","'sup","'",":","[","DetDataSample","]",",","'unsup_teacher","'",":","[","DetDataSample",",","DetDataSample","]",",","'unsup_student","'",":","[","DetDataSample",",","DetDataSample","]",",","}","}","Args",":","data_preprocessor","(",":","obj",":","`","ConfigDict","`","or","dict",")",":","Config","of",":","class",":","`","DetDataPreprocessor","`","to","process","the","input","data","."]
code: def __init__(self, data_preprocessor: ConfigType) -> None:
      super().__init__()
      self.data_preprocessor = MODELS.build(data_preprocessor)
  
imports: import random
  from numbers import Number
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmengine.dist import barrier, broadcast, get_dist_info
  from mmengine.logging import MessageHub
  from mmengine.model import BaseDataPreprocessor, ImgDataPreprocessor
  from mmengine.structures import PixelData
  from mmengine.utils import is_seq_of
  from torch import Tensor
  from mmdet.models.utils import unfold_wo_center
  from mmdet.models.utils.misc import samplelist_boxtype2tensor
  from mmdet.registry import MODELS
  from mmdet.structures import DetDataSample
  from mmdet.structures.mask import BitmapMasks
  from mmdet.utils import ConfigType
label_desc: Use image node_id 1 to create a new MultiBranchDataPreprocessor object from inherited base classes: BaseDataPreprocessor with example: obj = MultiBranchDataPreprocessor(data_preprocessor)