class_docstr: Base class for segmentation networks.
  
  Args:
      opts: Command-line arguments
      encoder: Image classification network
docstr: Add segmentation model specific arguments
docstr_tok: ["Add","segmentation","model","specific","arguments"]
code: def add_arguments(
      cls, parser: argparse.ArgumentParser
  ) -> argparse.ArgumentParser:
      """Add segmentation model specific arguments"""
      if cls != BaseSegmentation:
          # 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(
          "--model.segmentation.name",
          type=str,
          default=None,
          help="Segmentation model name. Defaults to None.",
      )
      group.add_argument(
          "--model.segmentation.n-classes",
          type=int,
          # FIXME: In another PR make this default value to None and update configs.
          default=21,
          help="Number of classes in the dataset. Defaults to 21.",
      )
      group.add_argument(
          "--model.segmentation.pretrained",
          type=str,
          default=None,
          help="Path of the pretrained segmentation model. Useful for evaluation",
      )
      group.add_argument(
          "--model.segmentation.lr-multiplier",
          type=float,
          default=1.0,
          help="Multiply the learning rate in segmentation network (e.g., decoder) by this factor."
          "Defaults to 1.0.",
      )
      group.add_argument(
          "--model.segmentation.classifier-dropout",
          type=float,
          default=0.1,
          help="Dropout rate in classifier",
      )
      group.add_argument(
          "--model.segmentation.use-aux-head",
          action="store_true",
          help="Use auxiliary output",
      )
      group.add_argument(
          "--model.segmentation.aux-dropout",
          default=0.1,
          type=float,
          help="Dropout in auxiliary branch",
      )
  
      group.add_argument(
          "--model.segmentation.output-stride",
          type=int,
          default=None,
          help="Output stride in classification network",
      )
      group.add_argument(
          "--model.segmentation.replace-stride-with-dilation",
          action="store_true",
          help="Replace stride with dilation",
      )
  
      group.add_argument(
          "--model.segmentation.activation.name",
          default=None,
          type=str,
          help="Non-linear function type",
      )
      group.add_argument(
          "--model.segmentation.activation.inplace",
          action="store_true",
          help="Inplace non-linear functions",
      )
      group.add_argument(
          "--model.segmentation.activation.neg-slope",
          default=0.1,
          type=float,
          help="Negative slope in leaky relu",
      )
      group.add_argument(
          "--model.segmentation.freeze-batch-norm",
          action="store_true",
          help="Freeze batch norm layers",
      )
  
      group.add_argument(
          "--model.segmentation.use-level5-exp",
          action="store_true",
          default=False,
          help="Use output of Level 5 expansion layer in base feature extractor",
      )
  
      group.add_argument(
          "--model.segmentation.finetune-pretrained-model",
          action="store_true",
          default=False,
          help="Finetune a pretrained segmentation model. Defaults to False.",
      )
      group.add_argument(
          "--model.segmentation.n-pretrained-classes",
          type=int,
          default=None,
          help="Number of classes in the pre-trained segmentation model. "
          "Defaults to None.",
      )
  
      group.add_argument(
          "--model.segmentation.norm-layer",
          type=str,
          default="batch_norm",
          help="Normalization layer for segmentation. Defaults to batch_norm.",
      )
      return parser
  
file_path: ml-cvnets/cvnets/models/segmentation/base_seg.py
imports: import argparse
  from typing import Any, Dict
  import torch
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel
  from cvnets.models.classification.base_image_encoder import BaseImageEncoder
label_desc: Use image node_id 2 for calling the BaseSegmentation obj's underlying member method code with example usage: obj.add_arguments(cls, parser) and returns: parser, parser