# transformers 5.24.1 (Apache-2.0), harvested by tools/harvest_corpus.py
=== input
Compute crop center and scale from bounding boxes, applying padding and aspect ratio correction.

    Accepts either a single box `(4,)` or multiple boxes `(num_boxes, 4)` and returns center/scale with a matching
    leading dimension.

    Args:
        boxes (`torch.Tensor` of shape `(4,)` or `(num_boxes, 4)`): Bounding box in
            (center-x, center-y, width, height) format, with values in absolute pixel coordinates.
        output_size (`tuple[int, int]`): Target output size as `(height, width)`, used to compute
            the aspect ratio for scale correction.
        padding (`float`, *optional*, defaults to `1.25`): Multiplicative factor applied to the
            bounding box dimensions, adding context around the region of interest.

    Returns:
        `tuple[torch.Tensor, torch.Tensor]`: A pair `(center, scale)` where `center` has shape
        `(..., 2)` with (x, y) in input-image pixel coordinates, and `scale` has shape `(..., 2)`
        with (width, height) in input-image pixels representing the dimensions of the padded,
        aspect-ratio-corrected crop window.
    
=== parse google
short_description: 'Compute crop center and scale from bounding boxes, applying padding and aspect ratio correction.'
long_description: |
  Accepts either a single box `(4,)` or multiple boxes `(num_boxes, 4)` and returns center/scale with a matching
  leading dimension.
blank_after_short_description: True
blank_after_long_description: True
style: google
- DocstringParam
  description: |
    Bounding box in
    (center-x, center-y, width, height) format, with values in absolute pixel coordinates.
  kind: param
  key: 'param'
  arg_name: 'boxes'
  type_name: '`torch.Tensor` of shape `(4,)` or `(num_boxes, 4)`'
  is_optional: False
- DocstringParam
  description: |
    Target output size as `(height, width)`, used to compute
    the aspect ratio for scale correction.
  kind: param
  key: 'param'
  arg_name: 'output_size'
  type_name: '`tuple[int, int]`'
  is_optional: False
- DocstringParam
  description: |
    Multiplicative factor applied to the
    bounding box dimensions, adding context around the region of interest.
  kind: param
  key: 'param'
  arg_name: 'padding'
  type_name: '`float`'
  is_optional: True
  default: '1.25'
  raw_type_name: '`float`, *optional*, defaults to `1.25`'
- DocstringReturns
  description: |
    `tuple[torch.Tensor, torch.Tensor]`: A pair `(center, scale)` where `center` has shape
    `(..., 2)` with (x, y) in input-image pixel coordinates, and `scale` has shape `(..., 2)`
    with (width, height) in input-image pixels representing the dimensions of the padded,
    aspect-ratio-corrected crop window.
  kind: returns
  key: 'returns'
  is_generator: False
=== detect
google
=== compose google
Compute crop center and scale from bounding boxes, applying padding and aspect ratio correction.

Accepts either a single box `(4,)` or multiple boxes `(num_boxes, 4)` and returns center/scale with a matching
leading dimension.

Args:
    boxes (`torch.Tensor` of shape `(4,)` or `(num_boxes, 4)`): Bounding box in
        (center-x, center-y, width, height) format, with values in absolute pixel coordinates.
    output_size (`tuple[int, int]`): Target output size as `(height, width)`, used to compute
        the aspect ratio for scale correction.
    padding (`float`, *optional*, defaults to `1.25`): Multiplicative factor applied to the
        bounding box dimensions, adding context around the region of interest.

Returns:
    `tuple[torch.Tensor, torch.Tensor]`: A pair `(center, scale)` where `center` has shape
    `(..., 2)` with (x, y) in input-image pixel coordinates, and `scale` has shape `(..., 2)`
    with (width, height) in input-image pixels representing the dimensions of the padded,
    aspect-ratio-corrected crop window.
