class_docstr: A ready-to-use SED interface (audio -> emotions and their durations)
  
  Arguments
  ---------
  hparams
      Hyperparameters (from HyperPyYAML)
  
  Example
  -------
  >>> from speechbrain.inference.diarization import Speech_Emotion_Diarization
  >>> tmpdir = getfixture("tmpdir")
  >>> sed_model = Speech_Emotion_Diarization.from_hparams(source="speechbrain/emotion-diarization-wavlm-large", savedir=tmpdir,) # doctest: +SKIP
  >>> sed_model.diarize_file("speechbrain/emotion-diarization-wavlm-large/example.wav") # doctest: +SKIP
docstr: Convert frame-wise predictions into a dictionary of
  diarization results.
  
  Returns
  -------
  dictionary
      A dictionary with the start/end of each emotion
code: def preds_to_diarization(self, prediction, batch_id):
      """Convert frame-wise predictions into a dictionary of
      diarization results.
  
      Returns
      -------
      dictionary
          A dictionary with the start/end of each emotion
      """
      results = {}
  
      for i in range(len(prediction)):
          pred = prediction[i]
          lol = []
          for j in range(len(pred)):
              start = round(self.hparams.stride * 0.02 * j, 2)
              end = round(start + self.hparams.window_length * 0.02, 2)
              lol.append([batch_id[i], start, end, pred[j]])
  
          lol = self.merge_ssegs_same_emotion_adjacent(lol)
          results[batch_id[i]] = [
              {"start": k[1], "end": k[2], "emotion": k[3]} for k in lol
          ]
          return results
  
file_path: speechbrain/speechbrain/inference/diarization.py
imports: import torch
  from speechbrain.inference.interfaces import Pretrained
label_desc: Use image node_id 5 for calling the Speech_Emotion_Diarization obj's underlying member method code with example usage: obj.preds_to_diarization(prediction, batch_id) and returns: results