code: def object_prediction_list_to_numpy(
      object_prediction_list: ObjectPredictionList,
  ) -> np.ndarray:
      """
      Returns:
          np.ndarray of size N x [x1, y1, x2, y2, score, category_id]
      """
      num_predictions = len(object_prediction_list)
      numpy_predictions = np.zeros(
          [num_predictions, 6], dtype=np.float32
      )
      for ind, object_prediction in enumerate(object_prediction_list):
          numpy_predictions[ind, :4] = np.array(
              object_prediction.tolist().bbox.to_xyxy(),
              dtype=np.float32,
          )
          numpy_predictions[
              ind, 4
          ] = object_prediction.tolist().score.value
          numpy_predictions[
              ind, 5
          ] = object_prediction.tolist().category.id
      return numpy_predictions
  
imports: from collections.abc import Sequence
  from typing import List, Union
  import numpy
  import torch
  from sahi.annotation import BoundingBox, Category, Mask
  from sahi.prediction import ObjectPrediction
label_desc: Use image node_id 2 for calling a global function with example usage: object_prediction_list_to_numpy(object_prediction_list) and returns: numpy_predictions