-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathScoring.py
36 lines (24 loc) · 1022 Bytes
/
Scoring.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from __future__ import division
import numpy as numpy
import pickle
import os
import sys
import code
import math
from multiprocessing import Pool, cpu_count
from accStat import Collect_Stats, MAPaDapt, Loglikelihood, htkread, multi_thread
#=====================================
# 3. GMM-UBM: scoring ||
#=====================================
print "scoring ..."
nmix=4
ubmDir= 'GMM' + str(nmix) #directory of "GMM-UBM" model
Tardest='MAP3_Tau10.0' #directory of target model
Scorefile='score.txt' #output file : scores
CORES=2 #[number of threads to be used]
Tstndx=numpy.loadtxt('Trial.lst', dtype=str) #loading the test trial list
with open(ubmDir + '/' + 'ubm') as f: #read ubm (once)
print "Load ubm .. %s" %(f)
ubm_mu, ubm_cov, ubm_w = pickle.load(f)
multi_thread(CORES, Tstndx, Tardest, Scorefile, ubm_mu, ubm_cov, ubm_w)
print("score --> %s\n" %(Scorefile))