prediction.py 文件源码

python
阅读 41 收藏 0 点赞 0 评论 0

项目:basis_speech 作者: CPUFronz 项目源码 文件源码
def _load_original_matrix(self):
        """Loades the original mgc matrix for the test file.

        This helper method loads the original matrix from the *.mgc file and
        matrix for the test file and also computes the staring times of the
        different phones.

        :returns: the original mgc matrix
        :returns: starting times of the phones
        """
        mgc_matrix = np.fromfile(MGC_DIR + self._filename + '.mgc', dtype=np.float32).reshape(-1, MGCORD+1)

        label = Label(LABEL_DIR + self._filename + '.lab')
        step_size = mgc_matrix.shape[0]/label.last_phone_end
        phone_starts = [int(round(p[1]*step_size)) for p in label.cur_phones_additions()]

        return mgc_matrix, phone_starts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号