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

        Converts model outputs into detected text boxes in corners format (xmin, ymin, xmax, ymax).

        Args:
            predictions: Model outputs with `logits` attribute (probability maps of shape `(batch_size, 1, H, W)`).
            threshold (float): Binarization threshold.
            target_sizes: Original image sizes (height, width) per image.
            box_threshold (float): Box score threshold.
            max_candidates (int): Maximum number of boxes.
            min_size (int): Minimum box size.
            unclip_ratio (float): Expansion ratio.

        Returns:
            list[dict]: List of detection results per image. Each dict contains:
                - "boxes": `torch.Tensor` of shape `(N, 4)` in corners format (xmin, ymin, xmax, ymax)
                - "scores": `torch.Tensor` of shape `(N,)`
                - "labels": `torch.Tensor` of shape `(N,)` (class id 0 for text)
        
=== parse google
short_description: 'Converts model outputs into detected text boxes in corners format (xmin, ymin, xmax, ymax).'
blank_after_short_description: True
blank_after_long_description: False
style: google
- DocstringParam
  description: 'Model outputs with `logits` attribute (probability maps of shape `(batch_size, 1, H, W)`).'
  kind: param
  key: 'param'
  arg_name: 'predictions'
  is_optional: False
- DocstringParam
  description: 'Binarization threshold.'
  kind: param
  key: 'param'
  arg_name: 'threshold'
  type_name: 'float'
  is_optional: False
- DocstringParam
  description: 'Original image sizes (height, width) per image.'
  kind: param
  key: 'param'
  arg_name: 'target_sizes'
  is_optional: False
- DocstringParam
  description: 'Box score threshold.'
  kind: param
  key: 'param'
  arg_name: 'box_threshold'
  type_name: 'float'
  is_optional: False
- DocstringParam
  description: 'Maximum number of boxes.'
  kind: param
  key: 'param'
  arg_name: 'max_candidates'
  type_name: 'int'
  is_optional: False
- DocstringParam
  description: 'Minimum box size.'
  kind: param
  key: 'param'
  arg_name: 'min_size'
  type_name: 'int'
  is_optional: False
- DocstringParam
  description: 'Expansion ratio.'
  kind: param
  key: 'param'
  arg_name: 'unclip_ratio'
  type_name: 'float'
  is_optional: False
- DocstringReturns
  description: |
    List of detection results per image. Each dict contains:
    - "boxes": `torch.Tensor` of shape `(N, 4)` in corners format (xmin, ymin, xmax, ymax)
    - "scores": `torch.Tensor` of shape `(N,)`
    - "labels": `torch.Tensor` of shape `(N,)` (class id 0 for text)
  kind: returns
  key: 'returns'
  type_name: 'list[dict]'
  is_generator: False
=== detect
google
=== compose google
Converts model outputs into detected text boxes in corners format (xmin, ymin, xmax, ymax).

Args:
    predictions: Model outputs with `logits` attribute (probability maps of shape `(batch_size, 1, H, W)`).
    threshold (float): Binarization threshold.
    target_sizes: Original image sizes (height, width) per image.
    box_threshold (float): Box score threshold.
    max_candidates (int): Maximum number of boxes.
    min_size (int): Minimum box size.
    unclip_ratio (float): Expansion ratio.

Returns:
    list[dict]: List of detection results per image. Each dict contains:
        - "boxes": `torch.Tensor` of shape `(N, 4)` in corners format (xmin, ymin, xmax, ymax)
        - "scores": `torch.Tensor` of shape `(N,)`
        - "labels": `torch.Tensor` of shape `(N,)` (class id 0 for text)
