code: def compute_frame_metrics(gt_pianoroll, pred_pianoroll):
      """Counts TP/FP/FN for framewise note activity assuming single-note audio."""
      gt_arr = np.squeeze(gt_pianoroll).max(axis=1)
      pred_arr = np.squeeze(pred_pianoroll).max(axis=1)
      assert gt_arr.shape == pred_arr.shape
      tp = np.logical_and(pred_arr > 0, gt_arr > 0).sum()
      fp = np.logical_and(pred_arr > 0, gt_arr == 0).sum()
      fn = np.logical_and(pred_arr == 0, gt_arr > 0).sum()
      return EvalCounts(tp, fp, fn)
  
imports: import dataclasses
  from absl import logging
  import ddsp
  import librosa
  import mir_eval
  import note_seq
  from note_seq import sequences_lib
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 8 for calling a global function with example usage: compute_frame_metrics(gt_pianoroll, pred_pianoroll) and returns: EvalCounts