Commit a92b3655 authored by Milos CERNAK's avatar Milos CERNAK

Fixed doctest

parent d590a9e6
Pipeline #10500 passed with stages
in 6 minutes and 37 seconds
......@@ -99,7 +99,7 @@ def test_plda_enroll():
plda = bob.kaldi.plda_train(feats, plda_file, mean_file)
# Enroll; plda[0] - PLDA model, plda[1] - PLDA global mean
enrolled = bob.kaldi.plda_enroll(feats, plda[1])
enrolled = bob.kaldi.plda_enroll(feats[0], plda[1])
assert enrolled.find('spk36')
......
......@@ -87,16 +87,17 @@ training, and PLDA scoring.
>>> plda_file = tempfile.NamedTemporaryFile()
>>> mean_file = tempfile.NamedTemporaryFile()
>>> spk_file = tempfile.NamedTemporaryFile()
>>> test_file = pkg_resources.resource_filename('bob.kaldi', 'data/test-mobio.ivector')
>>> features = pkg_resources.resource_filename('bob.kaldi', 'data/feats-mobio.npy')
>>> test_file = pkg_resources.resource_filename('bob.kaldi', 'test/data/test-mobio.ivector')
>>> features = pkg_resources.resource_filename('bob.kaldi', 'test/data/feats-mobio.npy')
>>> train_feats = numpy.load(features)
>>> test_feats = numpy.loadtxt(test_file)
>>> # Train PLDA model; plda[0] - PLDA model, plda[1] - global mean
>>> plda = bob.kaldi.plda_train(train_feats, plda_file, mean_file)
>>> plda = bob.kaldi.plda_train(train_feats, plda_file.name, mean_file.name)
>>> # Speaker enrollment (calculate average iVectors for the first speaker)
>>> enrolled = bob.kaldi.plda_enroll(train_feats[0], plda[1])
>>> # Calculate PLDA score
>>> score = bob.kaldi.plda_score(test_feats, enrolled, plda[0], plda[1])
>>> print ('%.4f' % score)
-23.9922
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment