code: def corner2bbox(corners: torch.Tensor) -> torch.Tensor:
      """Convert bbox coordinates from corners ((x1, y1), (x2, y1), (x1, y2),
      (x2, y2)) to (x1, y1, x2, y2).
  
      Args:
          corners (Tensor): Shape (n*4, 2) for corners.
      Returns:
          Tensor: Shape (n, 4) for bboxes.
      """
      corners = corners.reshape(-1, 4, 2)
      min_xy = corners.min(dim=1)[0]
      max_xy = corners.max(dim=1)[0]
      return torch.cat([min_xy, max_xy], dim=1)
  
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 14 for calling a global function with example usage: corner2bbox(corners) and returns: torch