class_docstr: This class represents masks in the form of bitmaps.
  
  Args:
      masks (ndarray): ndarray of masks in shape (N, H, W), where N is
          the number of objects.
      height (int): height of masks
      width (int): width of masks
class_docstr_tok: ["This","class","represents","masks","in","the","form","of","bitmaps",".","Args",":","masks","(","ndarray",")",":","ndarray","of","masks","in","shape","(","N",",","H",",","W",")",",","where","N","is","the","number","of","objects",".","height","(","int",")",":","height","of","masks","width","(","int",")",":","width","of","masks"]
docstr: Translate the BitmapMasks.
  
  Args:
      out_shape (tuple[int]): Shape for output mask, format (h, w).
      offset (int | float): The offset for translate.
      direction (str): The translate direction, either "horizontal"
          or "vertical".
      fill_val (int | float): Border value. Default 0 for masks.
      interpolation (str): Same as :func:`mmcv.imtranslate`.
  
  Returns:
      BitmapMasks: Translated BitmapMasks.
docstr_tok: ["Translate","the","BitmapMasks",".","Args",":","out_shape","(","tuple","[","int","]",")",":","Shape","for","output","mask",",","format","(","h",",","w",")",".","offset","(","int","|","float",")",":","The","offset","for","translate",".","direction","(","str",")",":","The","translate","direction",",","either","``","horizontal","''","or","``","vertical","''",".","fill_val","(","int","|","float",")",":","Border","value",".","Default","0","for","masks",".","interpolation","(","str",")",":","Same","as",":","func",":","`","mmcv.imtranslate","`",".","Returns",":","BitmapMasks",":","Translated","BitmapMasks","."]
code: def translate(
      self,
      out_shape,
      offset,
      direction="horizontal",
      fill_val=0,
      interpolation="bilinear",
  ):
      """Translate the BitmapMasks.
  
      Args:
          out_shape (tuple[int]): Shape for output mask, format (h, w).
          offset (int | float): The offset for translate.
          direction (str): The translate direction, either "horizontal"
              or "vertical".
          fill_val (int | float): Border value. Default 0 for masks.
          interpolation (str): Same as :func:`mmcv.imtranslate`.
  
      Returns:
          BitmapMasks: Translated BitmapMasks.
      """
      if len(self.masks) == 0:
          translated_masks = np.empty((0, *out_shape), dtype=np.uint8)
      else:
          translated_masks = mmcv.imtranslate(
              self.masks.transpose((1, 2, 0)),
              offset,
              direction,
              border_value=fill_val,
              interpolation=interpolation,
          )
          if translated_masks.ndim == 2:
              translated_masks = translated_masks[:, :, None]
          translated_masks = translated_masks.transpose(
              (2, 0, 1)
          ).astype(self.masks.dtype)
      return BitmapMasks(translated_masks, *out_shape)
  
imports: from abc import ABCMeta, abstractmethod
  import cv2
  import mmcv
  import numpy
  import pycocotools.mask
  import torch
  from mmcv.ops.roi_align import roi_align
label_desc: Use image node_id 13 for calling the BitmapMasks obj's underlying member method code with example usage: obj.translate(out_shape, offset, direction, fill_val, interpolation) and returns: BitmapMasks