code: def compute_mask_iou(inputs, targets):
      inputs = inputs.sigmoid()
      # thresholding
      binarized_inputs = (inputs >= 0.4).float()
      targets = (targets > 0.5).float()
      intersection = (binarized_inputs * targets).sum(-1)
      union = targets.sum(-1) + binarized_inputs.sum(-1) - intersection
      score = intersection / (union + 1e-6)
      return score
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from scipy.optimize import linear_sum_assignment
  from torch.cuda.amp import autocast
  from mmdet.registry import MODELS, TASK_UTILS
  from mmdet.utils import reduce_mean
label_desc: Use image node_id 1 for calling a global function with example usage: compute_mask_iou(inputs, targets) and returns: score