class_docstr: Pseudo mask pre-processor for BoxInst.
  
  Comparing with the :class:`mmdet.DetDataPreprocessor`,
  
  1. It generates masks using box annotations.
  2. It computes the images color similarity in LAB color space.
  
  Args:
      mask_stride (int): The mask output stride in boxinst. Defaults to 4.
      pairwise_size (int): The size of neighborhood for each pixel.
          Defaults to 3.
      pairwise_dilation (int): The dilation of neighborhood for each pixel.
          Defaults to 2.
      pairwise_color_thresh (float): The thresh of image color similarity.
          Defaults to 0.3.
      bottom_pixels_removed (int): The length of removed pixels in bottom.
          It is caused by the annotation error in coco dataset.
          Defaults to 10.
class_docstr_tok: ["Pseudo","mask","pre-processor","for","BoxInst",".","Comparing","with","the",":","class",":","`","mmdet.DetDataPreprocessor","`",",","1",".","It","generates","masks","using","box","annotations",".","2",".","It","computes","the","images","color","similarity","in","LAB","color","space",".","Args",":","mask_stride","(","int",")",":","The","mask","output","stride","in","boxinst",".","Defaults","to","4.","pairwise_size","(","int",")",":","The","size","of","neighborhood","for","each","pixel",".","Defaults","to","3.","pairwise_dilation","(","int",")",":","The","dilation","of","neighborhood","for","each","pixel",".","Defaults","to","2.","pairwise_color_thresh","(","float",")",":","The","thresh","of","image","color","similarity",".","Defaults","to","0.3.","bottom_pixels_removed","(","int",")",":","The","length","of","removed","pixels","in","bottom",".","It","is","caused","by","the","annotation","error","in","coco","dataset",".","Defaults","to","10","."]
code: def __init__(
      self,
      *arg,
      mask_stride: int = 4,
      pairwise_size: int = 3,
      pairwise_dilation: int = 2,
      pairwise_color_thresh: float = 0.3,
      bottom_pixels_removed: int = 10,
      **kwargs,
  ) -> None:
      super().__init__(*arg, **kwargs)
      self.mask_stride = mask_stride
      self.pairwise_size = pairwise_size
      self.pairwise_dilation = pairwise_dilation
      self.pairwise_color_thresh = pairwise_color_thresh
      self.bottom_pixels_removed = bottom_pixels_removed
  
      if skimage is None:
          raise RuntimeError(
              "skimage is not installed,\
                   please install it by: pip install scikit-image"
          )
  
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 BoxInstDataPreprocessor object from inherited base classes: DetDataPreprocessor with example: obj = BoxInstDataPreprocessor()