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
评论列表
文章目录