montreal_forced_aligner/transcription/transcriber.py
def calc_final_fmllr(self):
        """
        Calculate final fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.FinalFmllrFunction`
            Multiprocessing function
        :meth:`.Transcriber.final_fmllr_arguments`
            Arguments for function
        """
        self.logger.info("Calculating final fMLLR transforms...")
        sum_errors = 0
        with tqdm.tqdm(total=self.num_utterances) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.final_fmllr_arguments()):
                    function = FinalFmllrFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        done, no_gpost, other_errors = return_queue.get(timeout=1)
                        sum_errors += no_gpost + other_errors
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(done + no_gpost + other_errors)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.final_fmllr_arguments():
                    function = FinalFmllrFunction(args)
                    for done, no_gpost, other_errors in function.run():
                        sum_errors += no_gpost + other_errors
                        pbar.update(done + no_gpost + other_errors)
            if sum_errors:
                self.logger.warning(f"{sum_errors} utterances had errors on calculating fMLLR.")

        Calculate final fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.FinalFmllrFunction`
            Multiprocessing function
        :meth:`.Transcriber.final_fmllr_arguments`
            Arguments for function
        
Calculate final fMLLR transforms
See Also
Calculate final fMLLR transforms See Also
def calc_final_fmllr(self):
        self.logger.info("Calculating final fMLLR transforms...")
        sum_errors = 0
        with tqdm.tqdm(total=self.num_utterances) as pbar:
            if self.use_mp:
                manager = mp.Manager()
                error_dict = manager.dict()
                return_queue = manager.Queue()
                stopped = Stopped()
                procs = []
                for i, args in enumerate(self.final_fmllr_arguments()):
                    function = FinalFmllrFunction(args)
                    p = KaldiProcessWorker(i, return_queue, function, error_dict, stopped)
                    procs.append(p)
                    p.start()
                while True:
                    try:
                        done, no_gpost, other_errors = return_queue.get(timeout=1)
                        sum_errors += no_gpost + other_errors
                        if stopped.stop_check():
                            continue
                    except Empty:
                        for proc in procs:
                            if not proc.finished.stop_check():
                                break
                        else:
                            break
                        continue
                    pbar.update(done + no_gpost + other_errors)
                for p in procs:
                    p.join()
                if error_dict:
                    for v in error_dict.values():
                        raise v
            else:
                for args in self.final_fmllr_arguments():
                    function = FinalFmllrFunction(args)
                    for done, no_gpost, other_errors in function.run():
                        sum_errors += no_gpost + other_errors
                        pbar.update(done + no_gpost + other_errors)
            if sum_errors:
                self.logger.warning(f"{sum_errors} utterances had errors on calculating fMLLR.")
def calc_final_fmllr ( self ) : self . logger . info ( "Calculating final fMLLR transforms..." ) sum_errors = 0 with tqdm . tqdm ( total = self . num_utterances ) as pbar : if self . use_mp : manager = mp . Manager ( ) error_dict = manager . dict ( ) return_queue = manager . Queue ( ) stopped = Stopped ( ) procs = [ ] for i , args in enumerate ( self . final_fmllr_arguments ( ) ) : function = FinalFmllrFunction ( args ) p = KaldiProcessWorker ( i , return_queue , function , error_dict , stopped ) procs . append ( p ) p . start ( ) while True : try : done , no_gpost , other_errors = return_queue . get ( timeout = 1 ) sum_errors += no_gpost + other_errors if stopped . stop_check ( ) : continue except Empty : for proc in procs : if not proc . finished . stop_check ( ) : break else : break continue pbar . update ( done + no_gpost + other_errors ) for p in procs : p . join ( ) if error_dict : for v in error_dict . values ( ) : raise v else : for args in self . final_fmllr_arguments ( ) : function = FinalFmllrFunction ( args ) for done , no_gpost , other_errors in function . run ( ) : sum_errors += no_gpost + other_errors pbar . update ( done + no_gpost + other_errors ) if sum_errors : self . logger . warning ( f"{sum_errors} utterances had errors on calculating fMLLR." )
Calculate final fMLLR transforms
See Also
Calculate final fMLLR transforms See Also
"""
        Calculate final fMLLR transforms

        See Also
        -------
        :class:`~montreal_forced_aligner.transcription.multiprocessing.FinalFmllrFunction`
            Multiprocessing function
        :meth:`.Transcriber.final_fmllr_arguments`
            Arguments for function
        """
self
class
`~montreal_forced_aligner.transcription.multiprocessing.FinalFmllrFunction`
Multiprocessing function
` ~montreal_forced_aligner . transcription . multiprocessing . FinalFmllrFunction ` Multiprocessing function
meth
`.Transcriber.final_fmllr_arguments`
Arguments for function
` . Transcriber . final_fmllr_arguments ` Arguments for function