code: def get_metrics(
      features,
      labels,
      frame_probs,
      onset_probs,
      frame_predictions,
      onset_predictions,
      offset_predictions,
      velocity_values,
      hparams,
  ):
      """Return metrics values ops."""
      if hparams.drums_only:
          return _drums_only_metric_ops(
              features=features,
              labels=labels,
              frame_probs=frame_probs,
              onset_probs=onset_probs,
              frame_predictions=frame_predictions,
              onset_predictions=onset_predictions,
              offset_predictions=offset_predictions,
              velocity_values=velocity_values,
              hparams=hparams,
          )
      else:
          return metrics.define_metrics(
              frame_probs=frame_probs,
              onset_probs=onset_probs,
              frame_predictions=frame_predictions,
              onset_predictions=onset_predictions,
              offset_predictions=offset_predictions,
              velocity_values=velocity_values,
              length=features.length,
              sequence_label=labels.note_sequence,
              frame_labels=labels.labels,
              sequence_id=features.sequence_id,
              hparams=hparams,
          )
  
file_path: magenta/magenta/models/onsets_frames_transcription/estimator_spec_util.py
imports: import functools
  from magenta.models.onsets_frames_transcription import constants
  from magenta.models.onsets_frames_transcription import drum_mappings
  from magenta.models.onsets_frames_transcription import infer_util
  from magenta.models.onsets_frames_transcription import metrics
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tf_slim
label_desc: Use image node_id 2 for calling a global function with example usage: get_metrics(features, labels, frame_probs, onset_probs, frame_predictions, onset_predictions, offset_predictions, velocity_values, hparams) and returns: _drums_only_metric_ops, metrics