code: def roi2bbox(rois: Tensor) -> List[Tensor]:
      """Convert rois to bounding box format.
  
      Args:
          rois (Tensor): RoIs with the shape (n, 5) where the first
              column indicates batch id of each RoI.
  
      Returns:
          List[Tensor]: Converted boxes of corresponding rois.
      """
      bbox_list = []
      img_ids = torch.unique(rois[:, 0].cpu(), sorted=True)
      for img_id in img_ids:
          inds = rois[:, 0] == img_id.item()
          bbox = rois[inds, 1:]
          bbox_list.append(bbox)
      return bbox_list
  
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 6 for calling a global function with example usage: roi2bbox(rois) and returns: bbox_list