def _get_transformer_class_head_num_classes(
    auxiliary_semantic_head_output_channels,
    ignore_label):
  """Computes the num of classes for the transformer class head.

  The transformer class head predicts non-void classes (i.e., thing classes and
  stuff classes) and a void (i.e., ∅, no object) class. If the auxiliary
  semantic head output channel includes the void class, e.g., on COCO, we
  directly use the semantic output channel. Otherwise, e.g., on Cityscapes, we
  add 1 (the void class) to the transformer class head.

  Args:
    auxiliary_semantic_head_output_channels: An integer, the number of output
      channels of the auxiliary semantic head (it should be the same as the
      num_classes field of the dataset information).
    ignore_label: An integer specifying the ignore label. Default to 255.

  Returns:
    num_classes: An integer, the num of classes for the transformer class head.
  """
  if ignore_label >= auxiliary_semantic_head_output_channels:
    return auxiliary_semantic_head_output_channels + 1
  else:
    return auxiliary_semantic_head_output_channels