docstr: Args:
      bool_mask: np.ndarray with bool elements
          2D mask of object, should have a shape of height*width
      full_shape: List
          Size of the full image, should be in the form of [height, width]
      shift_amount: List
          To shift the box and mask predictions from sliced image to full
          sized image, should be in the form of [shift_x, shift_y]
docstr_tok: ["Args",":","bool_mask",":","np.ndarray","with","bool","elements","2D","mask","of","object",",","should","have","a","shape","of","height","*","width","full_shape",":","List","Size","of","the","full","image",",","should","be","in","the","form","of","[","height",",","width","]","shift_amount",":","List","To","shift","the","box","and","mask","predictions","from","sliced","image","to","full","sized","image",",","should","be","in","the","form","of","[","shift_x",",","shift_y","]"]
code: def __init__(
      self,
      bool_mask=None,
      full_shape=None,
      shift_amount: list = [0, 0],
  ):
      """
      Args:
          bool_mask: np.ndarray with bool elements
              2D mask of object, should have a shape of height*width
          full_shape: List
              Size of the full image, should be in the form of [height, width]
          shift_amount: List
              To shift the box and mask predictions from sliced image to full
              sized image, should be in the form of [shift_x, shift_y]
      """
  
      if len(bool_mask) > 0:
          has_bool_mask = True
      else:
          has_bool_mask = False
  
      if has_bool_mask:
          self._mask = self.encode_bool_mask(bool_mask)
      else:
          self._mask = None
  
      self.shift_x = shift_amount[0]
      self.shift_y = shift_amount[1]
  
      if full_shape:
          self.full_shape_height = full_shape[0]
          self.full_shape_width = full_shape[1]
      elif has_bool_mask:
          self.full_shape_height = self.bool_mask.shape[0]
          self.full_shape_width = self.bool_mask.shape[1]
      else:
          self.full_shape_height = None
          self.full_shape_width = None
  
imports: import copy
  from typing import Dict, List, Optional
  import numpy
  from sahi.utils.coco import CocoAnnotation, CocoPrediction
  from sahi.utils.cv import get_bbox_from_bool_mask, get_bool_mask_from_coco_segmentation, get_coco_segmentation_from_bool_mask
  from sahi.utils.shapely import ShapelyAnnotation
label_desc: Use image node_id 3 to create a new Mask object  with example: obj = Mask(bool_mask, full_shape, shift_amount)