code: def bbox_xyxy_to_cxcyah(bboxes: torch.Tensor) -> torch.Tensor:
      """Convert bbox coordinates from (x1, y1, x2, y2) to (cx, cy, ratio, h).
  
      Args:
          bbox (Tensor): Shape (n, 4) for bboxes.
  
      Returns:
          Tensor: Converted bboxes.
      """
      cx = (bboxes[:, 2] + bboxes[:, 0]) / 2
      cy = (bboxes[:, 3] + bboxes[:, 1]) / 2
      w = bboxes[:, 2] - bboxes[:, 0]
      h = bboxes[:, 3] - bboxes[:, 1]
      xyah = torch.stack([cx, cy, w / h, h], -1)
      return xyah
  
imports: from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import torch
  from torch import Tensor
  from mmdet.structures.bbox import BaseBoxes
label_desc: Use image node_id 22 for calling a global function with example usage: bbox_xyxy_to_cxcyah(bboxes) and returns: xyah