class_docstr: Dynamically compute power_db and f0_hz with optional centered frames.
class_docstr_tok: ["Dynamically","compute","power_db","and","f0_hz","with","optional","centered","frames","."]
code: def __init__(
      self,
      frame_rate=250,
      frame_size=1024,
      padding="center",
      compute_power=True,
      compute_f0=True,
      crepe_saved_model_path="full",
      viterbi=False,
      **kwargs,
  ):
      super().__init__(**kwargs)
      # Preprocessing must happen at 16kHz because CREPE trained at 16kHz.
      self.sample_rate = ddsp.spectral_ops.CREPE_SAMPLE_RATE
      self.frame_rate = frame_rate
      self.frame_size = frame_size
      self.hop_size = self.sample_rate // frame_rate
  
      self.compute_f0 = compute_f0
      self.compute_power = compute_power
  
      self.padding = padding
  
      # Crepe model, must either be a model size or path to SavedModel.
      if crepe_saved_model_path:
          self.crepe_model = ddsp.spectral_ops.PretrainedCREPE(
              model_size_or_path=crepe_saved_model_path,
              hop_size=self.hop_size,
          )
  
      # Use viterbi decoding.
      self.viterbi = viterbi
  
imports: import ddsp
  from ddsp.training import nn
  import gin
  import tensorflow
label_desc: Use image node_id 1 to create a new OnlineF0PowerPreprocessor object from inherited base classes: nn with example: obj = OnlineF0PowerPreprocessor(frame_rate, frame_size, padding, compute_power, compute_f0, crepe_saved_model_path, viterbi)