class_docstr: Mask RCNN loss is computed inside the MaskRCNN model. This class is a wrapper to extract
  loss values for different heads (RPN, classification, etc.) and compute the weighted sum.
  
  Args:
      opts: command-line arguments
class_docstr_tok: ["Mask","RCNN","loss","is","computed","inside","the","MaskRCNN","model",".","This","class","is","a","wrapper","to","extract","loss","values","for","different","heads","(","RPN",",","classification",",","etc",".",")","and","compute","the","weighted","sum",".","Args",":","opts",":","command-line","arguments"]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      if cls != MaskRCNNLoss:
          # Don't re-register arguments in subclasses that don't override `add_arguments()`.
          return parser
      group = parser.add_argument_group(title=cls.__name__)
      group.add_argument(
          "--loss.detection.mask-rcnn-loss.classifier-weight",
          type=float,
          default=1,
          help=f"Weight for classifier in {cls.__name__}. Defaults to 1.",
      )
      group.add_argument(
          "--loss.detection.mask-rcnn-loss.box-reg-weight",
          type=float,
          default=1,
          help=f"Weight for box reg in {cls.__name__}. Defaults to 1.",
      )
      group.add_argument(
          "--loss.detection.mask-rcnn-loss.mask-weight",
          type=float,
          default=1,
          help=f"Weight for mask in {cls.__name__}. Defaults to 1.",
      )
      group.add_argument(
          "--loss.detection.mask-rcnn-loss.objectness-weight",
          type=float,
          default=1,
          help=f"Weight for objectness in {cls.__name__}. Defaults to 1.",
      )
      group.add_argument(
          "--loss.detection.mask-rcnn-loss.rpn-box-reg",
          type=float,
          default=1,
          help=f"Weight for rpn box reg. in {cls.__name__}. Defaults to 1.",
      )
      return parser
  
file_path: ml-cvnets/loss_fn/detection/mask_rcnn_loss.py
imports: import argparse
  from typing import Any, Dict
  import torch
  from torch import Tensor
  from loss_fn import LOSS_REGISTRY
  from loss_fn.detection.base_detection_criteria import BaseDetectionCriteria
  from utils import logger
label_desc: Use image node_id 2 for calling the MaskRCNNLoss obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser