# transformers 5.24.1 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input

        Converts the output of [`Mask2FormerForUniversalSegmentation`] into semantic segmentation maps. Only supports
        PyTorch.

        Args:
            outputs ([`Mask2FormerForUniversalSegmentation`]):
                Raw outputs of the model.
            target_sizes (`list[tuple[int, int]]`, *optional*):
                List of length (batch_size), where each list item (`tuple[int, int]]`) corresponds to the requested
                final size (height, width) of each prediction. If left to None, predictions will not be resized.
            return_segmentation_scores (`bool`, *optional*, defaults to `False`):
                Whether to return segmentation scores alongside the segmentation map. When `True`, each element of
                the returned list is a [`SemanticSegmentationPostProcessorOutput`] with fields `segmentation`
                (class IDs, shape `(height, width)`) and `segmentation_scores` (shape `(num_classes, height, width)`).

        Returns:
            `list[torch.Tensor]` or `list[SemanticSegmentationPostProcessorOutput]`: When
            `return_segmentation_scores=False` (default), a list of length `batch_size` where each item is a
            segmentation map of shape `(height, width)` with class IDs. When `return_segmentation_scores=True`,
            a list of [`SemanticSegmentationPostProcessorOutput`] with fields `segmentation` (class IDs, shape
            `(height, width)`) and `segmentation_scores` (shape `(num_classes, height, width)`). In both cases,
            `(height, width)` corresponds to the target size (if `target_sizes` is specified).
        
=== parse google
short_description: |
  Converts the output of [`Mask2FormerForUniversalSegmentation`] into semantic segmentation maps. Only supports
  PyTorch.
blank_after_short_description: True
blank_after_long_description: False
style: google
- DocstringParam
  description: 'Raw outputs of the model.'
  kind: param
  key: 'param'
  arg_name: 'outputs'
  type_name: '[`Mask2FormerForUniversalSegmentation`]'
  is_optional: False
- DocstringParam
  description: |
    List of length (batch_size), where each list item (`tuple[int, int]]`) corresponds to the requested
    final size (height, width) of each prediction. If left to None, predictions will not be resized.
  kind: param
  key: 'param'
  arg_name: 'target_sizes'
  type_name: '`list[tuple[int, int]]`'
  is_optional: True
  raw_type_name: '`list[tuple[int, int]]`, *optional*'
- DocstringParam
  description: |
    Whether to return segmentation scores alongside the segmentation map. When `True`, each element of
    the returned list is a [`SemanticSegmentationPostProcessorOutput`] with fields `segmentation`
    (class IDs, shape `(height, width)`) and `segmentation_scores` (shape `(num_classes, height, width)`).
  kind: param
  key: 'param'
  arg_name: 'return_segmentation_scores'
  type_name: '`bool`'
  is_optional: True
  default: 'False'
  raw_type_name: '`bool`, *optional*, defaults to `False`'
- DocstringReturns
  description: |
    `list[torch.Tensor]` or `list[SemanticSegmentationPostProcessorOutput]`: When
    `return_segmentation_scores=False` (default), a list of length `batch_size` where each item is a
    segmentation map of shape `(height, width)` with class IDs. When `return_segmentation_scores=True`,
    a list of [`SemanticSegmentationPostProcessorOutput`] with fields `segmentation` (class IDs, shape
    `(height, width)`) and `segmentation_scores` (shape `(num_classes, height, width)`). In both cases,
    `(height, width)` corresponds to the target size (if `target_sizes` is specified).
  kind: returns
  key: 'returns'
  is_generator: False
=== detect
google
=== compose google
Converts the output of [`Mask2FormerForUniversalSegmentation`] into semantic segmentation maps. Only supports
PyTorch.

Args:
    outputs ([`Mask2FormerForUniversalSegmentation`]): Raw outputs of the model.
    target_sizes (`list[tuple[int, int]]`, *optional*): List of length (batch_size), where each list item (`tuple[int, int]]`) corresponds to the requested
        final size (height, width) of each prediction. If left to None, predictions will not be resized.
    return_segmentation_scores (`bool`, *optional*, defaults to `False`): Whether to return segmentation scores alongside the segmentation map. When `True`, each element of
        the returned list is a [`SemanticSegmentationPostProcessorOutput`] with fields `segmentation`
        (class IDs, shape `(height, width)`) and `segmentation_scores` (shape `(num_classes, height, width)`).

Returns:
    `list[torch.Tensor]` or `list[SemanticSegmentationPostProcessorOutput]`: When
    `return_segmentation_scores=False` (default), a list of length `batch_size` where each item is a
    segmentation map of shape `(height, width)` with class IDs. When `return_segmentation_scores=True`,
    a list of [`SemanticSegmentationPostProcessorOutput`] with fields `segmentation` (class IDs, shape
    `(height, width)`) and `segmentation_scores` (shape `(num_classes, height, width)`). In both cases,
    `(height, width)` corresponds to the target size (if `target_sizes` is specified).
