code: def draw_binary_masks(
      opts,
      pred_mask: Tensor,
      file_name: str,
      results_location: str,
      is_cityscape: Optional[bool] = False,
  ) -> None:
      """Save masks whose values ranges between 0 and number_of_classes - 1"""
      no_color_mask_dir = "{}/predictions_no_cmap".format(
          results_location
      )
      if not os.path.isdir(no_color_mask_dir):
          os.makedirs(no_color_mask_dir, exist_ok=True)
      no_color_mask_f_name = "{}/{}".format(
          no_color_mask_dir, file_name
      )
  
      if is_cityscape:
          # convert mask values to cityscapes format
          pred_mask = convert_to_cityscape_format(img=pred_mask)
      pred_mask_pil = F_vision.to_pil_image(pred_mask.byte())
      pred_mask_pil.save(no_color_mask_f_name)
  
imports: import copy
  import glob
  import os
  from typing import List, Optional, Tuple
  import torch
  from PIL import Image
  from torch import Tensor, nn
  from torch.nn import functional
  from torchvision.transforms import functional
  from tqdm import tqdm
  from common import SUPPORTED_IMAGE_EXTNS
  from cvnets import get_model
  from data import create_test_loader
  from engine.utils import autocast_fn
  from metrics.confusion_mat import ConfusionMatrix
  from options.opts import get_training_arguments
  from utils import logger, resources
  from utils.color_map import Colormap
  from utils.common_utils import create_directories, device_setup
  from utils.ddp_utils import is_master
  from utils.download_utils import get_local_path
  from utils.tensor_utils import image_size_from_opts
  from utils.visualization_utils import convert_to_cityscape_format
label_desc: Use image node_id 2 for calling a global function with example usage: draw_binary_masks(opts, pred_mask, file_name, results_location, is_cityscape) without return types