code: def get_upernet_config(model_name):
      auxiliary_in_channels = 384
      window_size = 7
      if "tiny" in model_name:
          embed_dim = 96
          depths = (2, 2, 6, 2)
          num_heads = (3, 6, 12, 24)
      elif "small" in model_name:
          embed_dim = 96
          depths = (2, 2, 18, 2)
          num_heads = (3, 6, 12, 24)
      elif "base" in model_name:
          embed_dim = 128
          depths = (2, 2, 18, 2)
          num_heads = (4, 8, 16, 32)
          window_size = 12
          auxiliary_in_channels = 512
      elif "large" in model_name:
          embed_dim = 192
          depths = (2, 2, 18, 2)
          num_heads = (6, 12, 24, 48)
          window_size = 12
          auxiliary_in_channels = 768
  
      # set label information
      num_labels = 150
      repo_id = "huggingface/label-files"
      filename = "ade20k-id2label.json"
      id2label = json.load(
          open(
              hf_hub_download(repo_id, filename, repo_type="dataset"),
              "r",
          )
      )
      id2label = {int(k): v for k, v in id2label.items()}
      label2id = {v: k for k, v in id2label.items()}
  
      backbone_config = SwinConfig(
          embed_dim=embed_dim,
          depths=depths,
          num_heads=num_heads,
          window_size=window_size,
          out_features=["stage1", "stage2", "stage3", "stage4"],
      )
      config = UperNetConfig(
          backbone_config=backbone_config,
          auxiliary_in_channels=auxiliary_in_channels,
          num_labels=num_labels,
          id2label=id2label,
          label2id=label2id,
      )
  
      return config
  
file_path: transformers/src/transformers/models/upernet/convert_swin_upernet_to_pytorch.py
imports: import argparse
  import json
  import requests
  import torch
  from huggingface_hub import hf_hub_download
  from PIL import Image
  from transformers import SegformerImageProcessor, SwinConfig, UperNetConfig, UperNetForSemanticSegmentation
label_desc: Use image node_id 1 for calling a global function with example usage: get_upernet_config(model_name) and returns: config