docstr: Convert detection results to a list of numpy arrays.
  
  Args:
      bboxes (paddle.Tensor | np.ndarray): shape (n, 5).
      labels (paddle.Tensor | np.ndarray): shape (n, ).
      kpts (paddle.Tensor | np.ndarray): shape (n, K, 3).
      num_classes (int): class number, including background class.
  
  Returns:
      list(ndarray): bbox and keypoint results of each class.
docstr_tok: ["Convert","detection","results","to","a","list","of","numpy","arrays",".","Args",":","bboxes","(","paddle.Tensor","|","np.ndarray",")",":","shape","(","n",",","5",")",".","labels","(","paddle.Tensor","|","np.ndarray",")",":","shape","(","n",",",")",".","kpts","(","paddle.Tensor","|","np.ndarray",")",":","shape","(","n",",","K",",","3",")",".","num_classes","(","int",")",":","class","number",",","including","background","class",".","Returns",":","list","(","ndarray",")",":","bbox","and","keypoint","results","of","each","class","."]
code: def bbox_kpt2result(self, bboxes, labels, kpts, num_classes):
      """Convert detection results to a list of numpy arrays.
  
      Args:
          bboxes (paddle.Tensor | np.ndarray): shape (n, 5).
          labels (paddle.Tensor | np.ndarray): shape (n, ).
          kpts (paddle.Tensor | np.ndarray): shape (n, K, 3).
          num_classes (int): class number, including background class.
  
      Returns:
          list(ndarray): bbox and keypoint results of each class.
      """
      if bboxes.shape[0] == 0:
          return [
              np.zeros((0, 5), dtype=np.float32)
              for i in range(num_classes)
          ], [
              np.zeros((0, kpts.size(1), 3), dtype=np.float32)
              for i in range(num_classes)
          ]
      else:
          if isinstance(bboxes, paddle.Tensor):
              bboxes = bboxes.numpy()
              labels = labels.numpy()
              kpts = kpts.numpy()
          return [bboxes[labels == i, :] for i in range(num_classes)], [
              kpts[labels == i, :, :] for i in range(num_classes)
          ]
  
file_path: PaddleDetection/ppdet/modeling/architectures/keypoint_petr.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import paddle
  from ppdet.core.workspace import register
  from .meta_arch import BaseArch
  from ..None import layers
label_desc: Use image node_id 8 for calling the PETR obj's underlying member method code with example usage: obj.bbox_kpt2result(bboxes, labels, kpts, num_classes) and returns: unknown,  unknown, unknown,  unknown