docstr: Compute match cost.
  
  Args:
      pred_instances (:obj:`InstanceData`): Predicted instances which
          must contain ``scores`` or ``masks``.
      gt_instances (:obj:`InstanceData`): Ground truth which must contain
          ``labels`` or ``mask``.
      img_meta (Optional[dict]): Image information. Defaults to None.
  
  Returns:
      Tensor: Match Cost matrix of shape (num_preds, num_gts).
code: def __call__(
      self,
      pred_instances: InstanceData,
      gt_instances: InstanceData,
      img_meta: Optional[dict] = None,
      **kwargs,
  ) -> Tensor:
      """Compute match cost.
  
      Args:
          pred_instances (:obj:`InstanceData`): Predicted instances which
              must contain ``scores`` or ``masks``.
          gt_instances (:obj:`InstanceData`): Ground truth which must contain
              ``labels`` or ``mask``.
          img_meta (Optional[dict]): Image information. Defaults to None.
  
      Returns:
          Tensor: Match Cost matrix of shape (num_preds, num_gts).
      """
      # gt_instances.text_token_mask is a repeated tensor of the same length
      # of instances. Only gt_instances.text_token_mask[0] is useful
      text_token_mask = torch.nonzero(
          gt_instances.text_token_mask[0]
      ).squeeze(-1)
      pred_scores = pred_instances.scores[:, text_token_mask]
      gt_labels = gt_instances.positive_maps[:, text_token_mask]
      return self._focal_loss_cost(pred_scores, gt_labels)
  
imports: from abc import abstractmethod
  from typing import Optional, Union
  import torch
  import torch.nn.functional
  from mmengine.structures import InstanceData
  from torch import Tensor
  from mmdet.registry import TASK_UTILS
  from mmdet.structures.bbox import bbox_overlaps, bbox_xyxy_to_cxcywh
label_desc: Use image node_id 2 for calling the BinaryFocalLossCost obj's underlying member method code with example usage: obj.__call__(pred_instances, gt_instances, img_meta) and returns: self