code: def get_args_parser(add_help=True):
      import argparse
  
      parser = argparse.ArgumentParser(
          description="PyTorch Detection Training", add_help=add_help
      )
  
      parser.add_argument(
          "--data-path",
          default="/datasets01/COCO/022719/",
          type=str,
          help="dataset path",
      )
      parser.add_argument(
          "--dataset",
          default="coco",
          type=str,
          help="dataset name. Use coco for object detection and instance segmentation and coco_kp for Keypoint detection",
      )
      parser.add_argument(
          "--model",
          default="maskrcnn_resnet50_fpn",
          type=str,
          help="model name",
      )
      parser.add_argument(
          "--device",
          default="cuda",
          type=str,
          help="device (Use cuda or cpu Default: cuda)",
      )
      parser.add_argument(
          "-b",
          "--batch-size",
          default=2,
          type=int,
          help="images per gpu, the total batch size is $NGPU x batch_size",
      )
      parser.add_argument(
          "--epochs",
          default=26,
          type=int,
          metavar="N",
          help="number of total epochs to run",
      )
      parser.add_argument(
          "-j",
          "--workers",
          default=4,
          type=int,
          metavar="N",
          help="number of data loading workers (default: 4)",
      )
      parser.add_argument(
          "--opt", default="sgd", type=str, help="optimizer"
      )
      parser.add_argument(
          "--lr",
          default=0.02,
          type=float,
          help="initial learning rate, 0.02 is the default value for training on 8 gpus and 2 images_per_gpu",
      )
      parser.add_argument(
          "--momentum",
          default=0.9,
          type=float,
          metavar="M",
          help="momentum",
      )
      parser.add_argument(
          "--wd",
          "--weight-decay",
          default=1e-4,
          type=float,
          metavar="W",
          help="weight decay (default: 1e-4)",
          dest="weight_decay",
      )
      parser.add_argument(
          "--norm-weight-decay",
          default=None,
          type=float,
          help="weight decay for Normalization layers (default: None, same value as --wd)",
      )
      parser.add_argument(
          "--lr-scheduler",
          default="multisteplr",
          type=str,
          help="name of lr scheduler (default: multisteplr)",
      )
      parser.add_argument(
          "--lr-step-size",
          default=8,
          type=int,
          help="decrease lr every step-size epochs (multisteplr scheduler only)",
      )
      parser.add_argument(
          "--lr-steps",
          default=[16, 22],
          nargs="+",
          type=int,
          help="decrease lr every step-size epochs (multisteplr scheduler only)",
      )
      parser.add_argument(
          "--lr-gamma",
          default=0.1,
          type=float,
          help="decrease lr by a factor of lr-gamma (multisteplr scheduler only)",
      )
      parser.add_argument(
          "--print-freq", default=20, type=int, help="print frequency"
      )
      parser.add_argument(
          "--output-dir",
          default=".",
          type=str,
          help="path to save outputs",
      )
      parser.add_argument(
          "--resume", default="", type=str, help="path of checkpoint"
      )
      parser.add_argument(
          "--start_epoch", default=0, type=int, help="start epoch"
      )
      parser.add_argument(
          "--aspect-ratio-group-factor", default=3, type=int
      )
      parser.add_argument(
          "--rpn-score-thresh",
          default=None,
          type=float,
          help="rpn score threshold for faster-rcnn",
      )
      parser.add_argument(
          "--trainable-backbone-layers",
          default=None,
          type=int,
          help="number of trainable layers of backbone",
      )
      parser.add_argument(
          "--data-augmentation",
          default="hflip",
          type=str,
          help="data augmentation policy (default: hflip)",
      )
      parser.add_argument(
          "--sync-bn",
          dest="sync_bn",
          help="Use sync batch norm",
          action="store_true",
      )
      parser.add_argument(
          "--test-only",
          dest="test_only",
          help="Only test the model",
          action="store_true",
      )
  
      parser.add_argument(
          "--use-deterministic-algorithms",
          action="store_true",
          help="Forces the use of deterministic algorithms only.",
      )
  
      # distributed training parameters
      parser.add_argument(
          "--world-size",
          default=1,
          type=int,
          help="number of distributed processes",
      )
      parser.add_argument(
          "--dist-url",
          default="env://",
          type=str,
          help="url used to set up distributed training",
      )
      parser.add_argument(
          "--weights",
          default=None,
          type=str,
          help="the weights enum name to load",
      )
      parser.add_argument(
          "--weights-backbone",
          default=None,
          type=str,
          help="the backbone weights enum name to load",
      )
  
      # Mixed precision training parameters
      parser.add_argument(
          "--amp",
          action="store_true",
          help="Use torch.cuda.amp for mixed precision training",
      )
  
      # Use CopyPaste augmentation training parameter
      parser.add_argument(
          "--use-copypaste",
          action="store_true",
          help="Use CopyPaste data augmentation. Works only with data-augmentation='lsj'.",
      )
  
      parser.add_argument(
          "--backend",
          default="PIL",
          type=str.lower,
          help="PIL or tensor - case insensitive",
      )
      parser.add_argument(
          "--use-v2", action="store_true", help="Use V2 transforms"
      )
  
      return parser
  
file_path: vision/references/detection/train.py
imports: import datetime
  import os
  import time
  import presets
  import torch
  import torch.utils.data
  import torchvision
  import torchvision.models.detection
  import torchvision.models.detection.mask_rcnn
  import utils
  from coco_utils import get_coco
  from engine import evaluate, train_one_epoch
  from group_by_aspect_ratio import create_aspect_ratio_groups, GroupedBatchSampler
  from torchvision.transforms import InterpolationMode
  from transforms import SimpleCopyPaste
label_desc: Use image node_id 4 for calling a global function with example usage: get_args_parser(add_help) and returns: parser