class_docstr: Manage Onsets and Frames TFLite model.
code: def __init__(self, model_path):
      self._interpreter = tflite.Interpreter(model_path=model_path)
      self._interpreter.allocate_tensors()
      self._input_details = self._interpreter.get_input_details()
      self._output_details = self._interpreter.get_output_details()
      self._output_index = {
          detail["name"]: detail["index"]
          for detail in self._output_details
      }
      self._input_wav_length = self._input_details[0]["shape"][0]
      self._output_roll_length = self._output_details[0]["shape"][1]
      assert (self._input_wav_length - Model.MODEL_WINDOW_LENGTH) % (
          self._output_roll_length - 1
      ) == 0
      self._hop_size = (
          self._input_wav_length - Model.MODEL_WINDOW_LENGTH
      ) // (self._output_roll_length - 1)
      self._timestep = float(self._hop_size) / Model.MODEL_SAMPLE_RATE
  
file_path: magenta/magenta/models/onsets_frames_transcription/realtime/tflite_model.py
imports: import importlib
  import numpy
label_desc: Use image node_id 1 to create a new Model object from inherited base classes: object with example: obj = Model(model_path)