montreal_forced_aligner/corpus/acoustic_corpus.py
def calc_cmvn(self) -> None:
        """
        Calculate CMVN statistics for speakers

        See Also
        --------
        :kaldi_src:`compute-cmvn-stats`
            Relevant Kaldi binary
        """
        spk2utt = os.path.join(self.corpus_output_directory, "spk2utt.scp")
        feats = os.path.join(self.corpus_output_directory, "feats.scp")
        cmvn_directory = os.path.join(self.features_directory, "cmvn")
        os.makedirs(cmvn_directory, exist_ok=True)
        cmvn_ark = os.path.join(cmvn_directory, "cmvn.ark")
        cmvn_scp = os.path.join(cmvn_directory, "cmvn.scp")
        log_path = os.path.join(cmvn_directory, "cmvn.log")
        with open(log_path, "w") as logf:
            subprocess.call(
                [
                    thirdparty_binary("compute-cmvn-stats"),
                    f"--spk2utt=ark:{spk2utt}",
                    f"scp:{feats}",
                    f"ark,scp:{cmvn_ark},{cmvn_scp}",
                ],
                stderr=logf,
                env=os.environ,
            )
        shutil.copy(cmvn_scp, os.path.join(self.corpus_output_directory, "cmvn.scp"))
        for s, cmvn in load_scp(cmvn_scp).items():
            self.speakers[s].cmvn = cmvn
        self.create_corpus_split()

        Calculate CMVN statistics for speakers

        See Also
        --------
        :kaldi_src:`compute-cmvn-stats`
            Relevant Kaldi binary
        
Calculate CMVN statistics for speakers
See Also
Calculate CMVN statistics for speakers See Also
def calc_cmvn(self) -> None:
        spk2utt = os.path.join(self.corpus_output_directory, "spk2utt.scp")
        feats = os.path.join(self.corpus_output_directory, "feats.scp")
        cmvn_directory = os.path.join(self.features_directory, "cmvn")
        os.makedirs(cmvn_directory, exist_ok=True)
        cmvn_ark = os.path.join(cmvn_directory, "cmvn.ark")
        cmvn_scp = os.path.join(cmvn_directory, "cmvn.scp")
        log_path = os.path.join(cmvn_directory, "cmvn.log")
        with open(log_path, "w") as logf:
            subprocess.call(
                [
                    thirdparty_binary("compute-cmvn-stats"),
                    f"--spk2utt=ark:{spk2utt}",
                    f"scp:{feats}",
                    f"ark,scp:{cmvn_ark},{cmvn_scp}",
                ],
                stderr=logf,
                env=os.environ,
            )
        shutil.copy(cmvn_scp, os.path.join(self.corpus_output_directory, "cmvn.scp"))
        for s, cmvn in load_scp(cmvn_scp).items():
            self.speakers[s].cmvn = cmvn
        self.create_corpus_split()
def calc_cmvn ( self ) -> None : spk2utt = os . path . join ( self . corpus_output_directory , "spk2utt.scp" ) feats = os . path . join ( self . corpus_output_directory , "feats.scp" ) cmvn_directory = os . path . join ( self . features_directory , "cmvn" ) os . makedirs ( cmvn_directory , exist_ok = True ) cmvn_ark = os . path . join ( cmvn_directory , "cmvn.ark" ) cmvn_scp = os . path . join ( cmvn_directory , "cmvn.scp" ) log_path = os . path . join ( cmvn_directory , "cmvn.log" ) with open ( log_path , "w" ) as logf : subprocess . call ( [ thirdparty_binary ( "compute-cmvn-stats" ) , f"--spk2utt=ark:{spk2utt}" , f"scp:{feats}" , f"ark,scp:{cmvn_ark},{cmvn_scp}" , ] , stderr = logf , env = os . environ , ) shutil . copy ( cmvn_scp , os . path . join ( self . corpus_output_directory , "cmvn.scp" ) ) for s , cmvn in load_scp ( cmvn_scp ) . items ( ) : self . speakers [ s ] . cmvn = cmvn self . create_corpus_split ( )
Calculate CMVN statistics for speakers
See Also
Calculate CMVN statistics for speakers See Also
"""
        Calculate CMVN statistics for speakers

        See Also
        --------
        :kaldi_src:`compute-cmvn-stats`
            Relevant Kaldi binary
        """
self
kaldi_src
`compute-cmvn-stats`
Relevant Kaldi binary
` compute - cmvn - stats ` Relevant Kaldi binary