code: def bbox2result(
      bboxes: Union[Tensor, np.ndarray],
      labels: Union[Tensor, np.ndarray],
      num_classes: int,
  ) -> List[np.ndarray]:
      """Convert detection results to a list of numpy arrays.
  
      Args:
          bboxes (Tensor | np.ndarray): shape (n, 5)
          labels (Tensor | np.ndarray): shape (n, )
          num_classes (int): class number, including background class
  
      Returns:
          List(np.ndarray]): bbox results of each class
      """
      if bboxes.shape[0] == 0:
          return [
              np.zeros((0, 5), dtype=np.float32)
              for i in range(num_classes)
          ]
      else:
          if isinstance(bboxes, torch.Tensor):
              bboxes = bboxes.detach().cpu().numpy()
              labels = labels.detach().cpu().numpy()
          return [bboxes[labels == i, :] for i in range(num_classes)]
  
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 7 for calling a global function with example usage: bbox2result(bboxes, labels, num_classes) and returns: unknown, unknown