code: def get_parser() -> ArgumentParser:
      """Get command line arguments.
  
      Example:
  
          Example for Torch Inference.
          >>> python tools/inference/gradio_inference.py  \
          ...     --weights ./results/padim/mvtec/bottle/weights/torch/model.pt
  
      Returns:
          ArgumentParser: Argument parser for gradio inference.
      """
      parser = ArgumentParser()
      parser.add_argument(
          "--weights",
          type=Path,
          required=True,
          help="Path to model weights",
      )
      parser.add_argument(
          "--metadata",
          type=Path,
          required=False,
          help="Path to a JSON file containing the metadata.",
      )
      parser.add_argument(
          "--share",
          type=bool,
          required=False,
          default=False,
          help="Share Gradio `share_url`",
      )
  
      return parser
  
file_path: anomalib/tools/inference/gradio_inference.py
imports: from __future__ import annotations
  from argparse import ArgumentParser
  from importlib import import_module
  from pathlib import Path
  import gradio
  import gradio.inputs
  import gradio.outputs
  import numpy
  from anomalib.deploy import Inferencer
label_desc: Use image node_id 1 for calling a global function with example usage: get_parser() and returns: parser