class_docstr: Apply speaker embedding extraction on hidden layer outputs. 
docstr: Implementation of postprocessing. 
docstr_tok: ["Implementation","of","postprocessing","."]
code: def call(self, predictions, log_verbose=False):
      """Implementation of postprocessing."""
      if self.infer:
          file_pointers = collections.defaultdict(dict)
          for output_level in self.output_levels:
              for output_key in self.outputs:
                  file_path = self.output_files[output_level][
                      output_key
                  ]
                  file_pointers[output_level][output_key] = WriteHelper(
                      f"ark,t,scp:{file_path}.ark,{file_path}.scp"
                  )
  
      utt2clips = collections.defaultdict(list)
      last_utt = None
      num_clips_processed = 0
  
      def _process_utt(utt):
          num_clips = 0
          chunks_out = collections.defaultdict(list)
          for i, item in enumerate(utt2clips[utt]):
              logging.debug(f"{utt} {item[0]} {utt}")
              num_clips += 1
  
              for j, output_key in enumerate(self.outputs):
                  chunk_output = item[
                      j + 1
                  ]  # offset 1 for first filed is clipid
                  chunks_out[output_key].append(chunk_output)
                  if self.infer:
                      chunk_key = utt.decode() + "_" + str(item[0])
                      if "chunk" in self.output_levels:
                          file_pointers["chunk"][output_key](
                              chunk_key, chunk_output
                          )
  
          utts_out = collections.defaultdict(
              lambda: np.zeros((None), dtype=np.float32)
          )
          for i, output_key in enumerate(self.outputs):
              utt_output = np.mean(chunks_out[output_key], axis=0)
              utts_out[output_key] = utt_output
              utt_key = utt.decode()
              if self.infer:
                  if "utt" in self.output_levels:
                      file_pointers["utt"][output_key](
                          utt_key, utt_output
                      )
          return num_clips
  
      for batch_index, batch in enumerate(predictions):
          # batch = {'inputs': [clip_0, clip_1, ...],
          #          'labels': [clip_0, clip_1, ...],
          #          'embeddings': [clip_0, clip_1, ...],
          #          'clipid': [clip_0, clip_1, ...],
          #          'filepath': [clip_0, clip_1, ...],
          #          ...}
          # Now we extract each clip from the minibatch.
          logging.debug(
              f"{batch_index} {batch.keys()} {batch['labels']} {batch['clipid']}"
          )
          for i, utt in enumerate(batch["filepath"]):
              if last_utt is None:
                  last_utt = utt
  
              value = (batch["clipid"][i],)
              for key in self.outputs:
                  value += (
                      batch[key][i],
                  )  # utt -> (clipid, skpid, embeddings, ...)
              utt2clips[utt].append(value)
              logging.debug(
                  f"utt2clips: {utt} {value[0]} {len(utt2clips[utt])}"
              )
  
              if last_utt != utt:
                  num_clips_processed += _process_utt(last_utt)
                  last_utt = utt
  
          if (batch_index + 1) % 10 == 0:
              logging.info(
                  "Processed %d batches, %d clips."
                  % (batch_index + 1, num_clips_processed)
              )
  
      # save last
      num_clips_processed += _process_utt(last_utt)
      logging.info("Processed %d clips." % (num_clips_processed))
  
      # close files
      if self.infer:
          for output_level in self.output_levels:
              for output_key in self.outputs:
                  file_pointers[output_level][output_key].close()
  
      logging.info("Postprocessing completed.")
  
file_path: delta/delta/utils/postprocess/speaker_cls_proc.py
imports: import os
  import collections
  import numpy
  from absl import logging
  from kaldiio import WriteHelper
  from delta.utils.postprocess.base_postproc import PostProc
  from delta.utils.register import registers
label_desc: Use image node_id 2 for calling the SpkUttPostProc obj's underlying member method code with example usage: obj.call(predictions, log_verbose) and returns: num_clips