class_docstr: Inference model Class for offline speaker diarization. 
  This class handles required functionality for diarization : Speech Activity Detection, Segmentation, 
  Extract Embeddings, Clustering, Resegmentation and Scoring. 
  All the parameters are passed through config file 
docstr: Run voice activity detection. 
  Get log probability of voice activity detection and smoothes using the post processing parameters. 
  Using generated frame level predictions generated manifest file for later speaker embedding extraction.
  input:
  manifest_file (str) : Manifest file containing path to audio file and label as infer
docstr_tok: ["Run","voice","activity","detection",".","Get","log","probability","of","voice","activity","detection","and","smoothes","using","the","post","processing","parameters",".","Using","generated","frame","level","predictions","generated","manifest","file","for","later","speaker","embedding","extraction",".","input",":","manifest_file","(","str",")",":","Manifest","file","containing","path","to","audio","file","and","label","as","infer"]
code: def _run_vad(self, manifest_file):
      """
      Run voice activity detection.
      Get log probability of voice activity detection and smoothes using the post processing parameters.
      Using generated frame level predictions generated manifest file for later speaker embedding extraction.
      input:
      manifest_file (str) : Manifest file containing path to audio file and label as infer
  
      """
  
      shutil.rmtree(self._vad_dir, ignore_errors=True)
      os.makedirs(self._vad_dir)
  
      self._vad_model.eval()
  
      time_unit = int(
          self._vad_window_length_in_sec / self._vad_shift_length_in_sec
      )
      trunc = int(time_unit / 2)
      trunc_l = time_unit - trunc
      all_len = 0
      data = []
      for line in open(manifest_file, "r", encoding="utf-8"):
          file = json.loads(line)["audio_filepath"]
          data.append(get_uniqname_from_filepath(file))
  
      status = get_vad_stream_status(data)
      for i, test_batch in enumerate(
          tqdm(
              self._vad_model.test_dataloader(),
              desc="vad",
              leave=True,
              disable=not self.verbose,
          )
      ):
          test_batch = [
              x.to(self._vad_model.device) for x in test_batch
          ]
          with autocast():
              log_probs = self._vad_model(
                  input_signal=test_batch[0],
                  input_signal_length=test_batch[1],
              )
              probs = torch.softmax(log_probs, dim=-1)
              pred = probs[:, 1]
              if status[i] == "start":
                  to_save = pred[:-trunc]
              elif status[i] == "next":
                  to_save = pred[trunc:-trunc_l]
              elif status[i] == "end":
                  to_save = pred[trunc_l:]
              else:
                  to_save = pred
              all_len += len(to_save)
              outpath = os.path.join(self._vad_dir, data[i] + ".frame")
              with open(outpath, "a", encoding="utf-8") as fout:
                  for f in range(len(to_save)):
                      fout.write("{0:0.4f}\n".format(to_save[f]))
          del test_batch
          if status[i] == "end" or status[i] == "single":
              all_len = 0
  
      if not self._vad_params.smoothing:
          # Shift the window by 10ms to generate the frame and use the prediction of the window to represent the label for the frame;
          self.vad_pred_dir = self._vad_dir
          frame_length_in_sec = self._vad_shift_length_in_sec
      else:
          # Generate predictions with overlapping input segments. Then a smoothing filter is applied to decide the label for a frame spanned by multiple segments.
          # smoothing_method would be either in majority vote (median) or average (mean)
          logging.info(
              "Generating predictions with overlapping input segments"
          )
          smoothing_pred_dir = generate_overlap_vad_seq(
              frame_pred_dir=self._vad_dir,
              smoothing_method=self._vad_params.smoothing,
              overlap=self._vad_params.overlap,
              window_length_in_sec=self._vad_window_length_in_sec,
              shift_length_in_sec=self._vad_shift_length_in_sec,
              num_workers=self._cfg.num_workers,
          )
          self.vad_pred_dir = smoothing_pred_dir
          frame_length_in_sec = 0.01
  
      logging.info(
          "Converting frame level prediction to speech/no-speech segment in start and end times format."
      )
  
      vad_params = (
          self._vad_params
          if isinstance(self._vad_params, (DictConfig, dict))
          else self._vad_params.dict()
      )
      table_out_dir = generate_vad_segment_table(
          vad_pred_dir=self.vad_pred_dir,
          postprocessing_params=vad_params,
          frame_length_in_sec=frame_length_in_sec,
          num_workers=self._cfg.num_workers,
          out_dir=self._vad_dir,
      )
  
      AUDIO_VAD_RTTM_MAP = {}
      for key in self.AUDIO_RTTM_MAP:
          if os.path.exists(os.path.join(table_out_dir, key + ".txt")):
              AUDIO_VAD_RTTM_MAP[key] = deepcopy(
                  self.AUDIO_RTTM_MAP[key]
              )
              AUDIO_VAD_RTTM_MAP[key]["rttm_filepath"] = os.path.join(
                  table_out_dir, key + ".txt"
              )
          else:
              logging.warning(
                  f"no vad file found for {key} due to zero or negative duration"
              )
  
      write_rttm2manifest(AUDIO_VAD_RTTM_MAP, self._vad_out_file)
      self._speaker_manifest_path = self._vad_out_file
  
imports: import json
  import os
  import pickle
  import shutil
  import tarfile
  import tempfile
  from copy import deepcopy
  from typing import Any, List, Optional, Union
  import torch
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning.utilities import rank_zero_only
  from tqdm import tqdm
  from nemo.collections.asr.metrics.der import score_labels
  from nemo.collections.asr.models.classification_models import EncDecClassificationModel
  from nemo.collections.asr.models.label_models import EncDecSpeakerLabelModel
  from nemo.collections.asr.parts.mixins.mixins import DiarizationMixin
  from nemo.collections.asr.parts.utils.speaker_utils import audio_rttm_map, get_embs_and_timestamps, get_uniqname_from_filepath, parse_scale_configs, perform_clustering, segments_manifest_to_subsegments_manifest, validate_vad_manifest, write_rttm2manifest
  from nemo.collections.asr.parts.utils.vad_utils import generate_overlap_vad_seq, generate_vad_segment_table, get_vad_stream_status, prepare_manifest
  from nemo.core.classes import Model
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 7 for calling the ClusteringDiarizer obj's underlying member method code with example usage: obj._run_vad(manifest_file) without return types