code: def get_parser() -> ArgumentParser:
      """Get parser.
  
      Returns:
          ArgumentParser: The parser object.
      """
      parser = ArgumentParser()
      parser.add_argument(
          "--weights",
          type=Path,
          required=True,
          help="Path to model weights",
      )
      parser.add_argument(
          "--input",
          type=Path,
          required=True,
          help="Path to an image to infer.",
      )
      parser.add_argument(
          "--output",
          type=Path,
          required=False,
          help="Path to save the output image.",
      )
      parser.add_argument(
          "--device",
          type=str,
          required=False,
          default="auto",
          help="Device to use for inference. Defaults to auto.",
          choices=[
              "auto",
              "cpu",
              "gpu",
              "cuda",
          ],  # cuda and gpu are the same but provided for convenience
      )
      parser.add_argument(
          "--task",
          type=str,
          required=False,
          help="Task type.",
          default="classification",
          choices=["classification", "detection", "segmentation"],
      )
      parser.add_argument(
          "--visualization_mode",
          type=str,
          required=False,
          default="simple",
          help="Visualization mode.",
          choices=["full", "simple"],
      )
      parser.add_argument(
          "--show",
          action="store_true",
          required=False,
          help="Show the visualized predictions on the screen.",
      )
  
      return parser
  
file_path: anomalib/tools/inference/torch_inference.py
imports: import warnings
  from argparse import ArgumentParser, Namespace
  from pathlib import Path
  import torch
  from anomalib.data.utils import generate_output_image_filename, get_image_filenames, read_image
  from anomalib.deploy import TorchInferencer
  from anomalib.post_processing import Visualizer
label_desc: Use image node_id 1 for calling a global function with example usage: get_parser() and returns: parser