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: See :func:`BaseInstanceMasks.crop_and_resize`.
docstr_tok: ["See",":","func",":","`","BaseInstanceMasks.crop_and_resize","`","."]
code: def crop_and_resize(
      self,
      bboxes,
      out_shape,
      inds,
      device="cpu",
      interpolation="bilinear",
  ):
      """See :func:`BaseInstanceMasks.crop_and_resize`."""
      if len(self.masks) == 0:
          empty_masks = np.empty((0, *out_shape), dtype=np.uint8)
          return BitmapMasks(empty_masks, *out_shape)
  
      # convert bboxes to tensor
      if isinstance(bboxes, np.ndarray):
          bboxes = torch.from_numpy(bboxes).to(device=device)
      if isinstance(inds, np.ndarray):
          inds = torch.from_numpy(inds).to(device=device)
  
      num_bbox = bboxes.shape[0]
      fake_inds = torch.arange(num_bbox, device=device).to(
          dtype=bboxes.dtype
      )[:, None]
      rois = torch.cat([fake_inds, bboxes], dim=1)  # Nx5
      rois = rois.to(device=device)
      if num_bbox > 0:
          gt_masks_th = (
              torch.from_numpy(self.masks)
              .to(device)
              .index_select(0, inds)
              .to(dtype=rois.dtype)
          )
          targets = roi_align(
              gt_masks_th[:, None, :, :],
              rois,
              out_shape,
              1.0,
              0,
              "avg",
              True,
          ).squeeze(1)
          resized_masks = (targets >= 0.5).cpu().numpy()
      else:
          resized_masks = []
      return BitmapMasks(resized_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 11 for calling the BitmapMasks obj's underlying member method code with example usage: obj.crop_and_resize(bboxes, out_shape, inds, device, interpolation) and returns: BitmapMasks, BitmapMasks