Commit 7a3a786c authored by Saeed SARFJOO's avatar Saeed SARFJOO

add test for loading plda and vector reading from read_mat function

parent ab6cca0b
Pipeline #25392 failed with stage
in 14 minutes and 55 seconds
This diff is collapsed.
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Seyyed Saeed Sarfjoo <>
# Tue 11 Dec 2018 10:39:15 CET
'''Tests for Kaldi bindings'''
import pkg_resources
import numpy as np
import bob.kaldi
from import read_mat_ark, read_plda
def test_plda():
plda_file = pkg_resources.resource_filename(__name__, 'data/plda')
plda_dic = read_plda(plda_file)
offset_= -1.0 *['transform'] , plda_dic['mean']).T
assert np.sum(offset_) > 0 and np.sum(offset_) < 1
def test_readmatrix():
ivector_ark = pkg_resources.resource_filename(__name__, 'data/ivector.ark')
# read vector ark with read_mat function
d = { key:mat for key,mat in read_mat_ark(ivector_ark) }
assert len(d) == 281
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment