code: def segmentation_counts_per_class(
      y_true_onehot: np.ndarray, y_pred_onehot: np.ndarray
  ):
      """Compute the ground truth, predicted and intersection areas per class for segmentation metrics."""
      tp_onehot = np.logical_and(y_true_onehot, y_pred_onehot)
      tp_count_per_class = np.asarray(
          [
              np.sum(tp_onehot[channel])
              for channel in range(tp_onehot.shape[0])
          ]
      )
      y_true_count_per_class = np.asarray(
          [
              np.sum(y_true_onehot[channel])
              for channel in range(tp_onehot.shape[0])
          ]
      )
      pred_count_per_class = np.asarray(
          [
              np.sum(y_pred_onehot[channel])
              for channel in range(tp_onehot.shape[0])
          ]
      )
      return (
          tp_count_per_class,
          y_true_count_per_class,
          pred_count_per_class,
      )
  
imports: from typing import Tuple
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: segmentation_counts_per_class(y_true_onehot, y_pred_onehot) and returns: tp_count_per_class,  y_true_count_per_class,  pred_count_per_class