code: def compute_note_metrics(gt_sequence, pred_sequence):
      """Computes metrics for predicted sequence given ground truth in controls."""
      gt_intervals, gt_pitches, _ = sequence2intervals(gt_sequence)
      pred_intervals, pred_pitches, _ = sequence2intervals(
          pred_sequence
      )
      onset_matching = mir_eval.transcription.match_notes(
          gt_intervals,
          ddsp.core.midi_to_hz(gt_pitches),
          pred_intervals,
          ddsp.core.midi_to_hz(pred_pitches),
          offset_ratio=None,
      )
      onset_metrics = EvalCounts(
          tp=len(onset_matching),
          fp=len(pred_pitches) - len(onset_matching),
          fn=len(gt_pitches) - len(onset_matching),
      )
  
      offset_matching = mir_eval.transcription.match_notes(
          gt_intervals,
          ddsp.core.midi_to_hz(gt_pitches),
          pred_intervals,
          ddsp.core.midi_to_hz(pred_pitches),
      )
  
      full_note_metrics = EvalCounts(
          tp=len(offset_matching),
          fp=len(pred_pitches) - len(offset_matching),
          fn=len(gt_pitches) - len(offset_matching),
      )
  
      return onset_metrics, full_note_metrics
  
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 7 for calling a global function with example usage: compute_note_metrics(gt_sequence, pred_sequence) and returns: onset_metrics,  full_note_metrics