class_docstr: A wrapper around a pretrained CREPE model, for pitch prediction.
  
  Enables predicting pitch and confidence entirely in TF for running in batch
  on accelerators. For [full,large,small,tiny] crepe models, reads h5 models
  from installed pip package. Other saved models
class_docstr_tok: ["A","wrapper","around","a","pretrained","CREPE","model",",","for","pitch","prediction",".","Enables","predicting","pitch","and","confidence","entirely","in","TF","for","running","in","batch","on","accelerators",".","For","[","full",",","large",",","small",",","tiny","]","crepe","models",",","reads","h5","models","from","installed","pip","package",".","Other","saved","models"]
code: def predict_f0_and_confidence(
      self, audio, viterbi=False, padding="center"
  ):
      audio = audio[None, :] if len(audio.shape) == 1 else audio
      batch_size = audio.shape[0]
  
      audio = pad(
          audio, self.frame_size, self.hop_size, padding=padding
      )
  
      frames = self.batch_frames(audio)
      frames = self.normalize_frames(frames)
      acts = self.core_model(frames, training=False)
  
      if viterbi:
          acts_viterbi = tf.reshape(acts, [batch_size, -1, 360])
          centers = self.viterbi_decode(acts_viterbi)
          centers = tf.reshape(centers, [-1])
      else:
          centers = None
  
      f0_hz, confidence = self.activations_to_f0_and_confidence(
          acts, centers
      )
      f0_hz = tf.reshape(f0_hz, [batch_size, -1])
      confidence = tf.reshape(confidence, [batch_size, -1])
      return f0_hz, confidence
  
imports: import crepe
  from ddsp import core
  from ddsp.core import safe_log
  from ddsp.core import tf_float32
  import gin
  import librosa
  import numpy
  import tensorflow.compat.v2
  import tensorflow_probability
label_desc: Use image node_id 5 for calling the PretrainedCREPE obj's underlying member method code with example usage: obj.predict_f0_and_confidence(audio, viterbi, padding) and returns: f0_hz,  confidence