class_docstr: YOLACT mask head used in https://arxiv.org/abs/1904.02689.
  
  This head outputs the mask prototypes for YOLACT.
  
  Args:
      in_channels (int): Number of channels in the input feature map.
      proto_channels (tuple[int]): Output channels of protonet convs.
      proto_kernel_sizes (tuple[int]): Kernel sizes of protonet convs.
      include_last_relu (Bool): If keep the last relu of protonet.
      num_protos (int): Number of prototypes.
      num_classes (int): Number of categories excluding the background
          category.
      loss_mask_weight (float): Reweight the mask loss by this factor.
      max_masks_to_train (int): Maximum number of masks to train for
          each image.
docstr: Compute instance segmentation targets for each image.
  
  Args:
      mask_pred (Tensor): Predicted prototypes with shape
          (num_classes, H, W).
      gt_masks (Tensor): Ground truth masks for each image with
          the same shape of the input image.
      pos_assigned_gt_inds (Tensor): GT indices of the corresponding
          positive samples.
  Returns:
      Tensor: Instance segmentation targets with shape
          (num_instances, H, W).
docstr_tok: ["Compute","instance","segmentation","targets","for","each","image",".","Args",":","mask_pred","(","Tensor",")",":","Predicted","prototypes","with","shape","(","num_classes",",","H",",","W",")",".","gt_masks","(","Tensor",")",":","Ground","truth","masks","for","each","image","with","the","same","shape","of","the","input","image",".","pos_assigned_gt_inds","(","Tensor",")",":","GT","indices","of","the","corresponding","positive","samples",".","Returns",":","Tensor",":","Instance","segmentation","targets","with","shape","(","num_instances",",","H",",","W",")","."]
code: def get_targets(self, mask_pred, gt_masks, pos_assigned_gt_inds):
      """Compute instance segmentation targets for each image.
  
      Args:
          mask_pred (Tensor): Predicted prototypes with shape
              (num_classes, H, W).
          gt_masks (Tensor): Ground truth masks for each image with
              the same shape of the input image.
          pos_assigned_gt_inds (Tensor): GT indices of the corresponding
              positive samples.
      Returns:
          Tensor: Instance segmentation targets with shape
              (num_instances, H, W).
      """
      if gt_masks.size(0) == 0:
          return None
      mask_h, mask_w = mask_pred.shape[-2:]
      gt_masks = F.interpolate(
          gt_masks.unsqueeze(0),
          (mask_h, mask_w),
          mode="bilinear",
          align_corners=False,
      ).squeeze(0)
      gt_masks = gt_masks.gt(0.5).float()
      mask_targets = gt_masks[pos_assigned_gt_inds]
      return mask_targets
  
imports: import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.cnn import ConvModule, xavier_init
  from mmcv.runner import force_fp32
  from mmdet.core import build_sampler, fast_nms, images_to_levels, multi_apply
  from ..builder import HEADS, build_loss
  from .anchor_head import AnchorHead
label_desc: Use image node_id 6 for calling the YOLACTProtonet obj's underlying member method code with example usage: obj.get_targets(mask_pred, gt_masks, pos_assigned_gt_inds) and returns: mask_targets, None