コード例 #1
0
 def _get_gmm_set(self):
     if self.UBM_MODEL_FILE and os.path.isfile(self.UBM_MODEL_FILE):
         try:
             from gmmset import GMMSetPyGMM
             if GMMSet is GMMSetPyGMM:
                 return GMMSet(ubm=GMM.load(self.UBM_MODEL_FILE))
         except Exception as e:
             print "Warning: failed to import gmmset. You may forget to compile gmm:"
             print e
             print "Try running `make -C src/gmm` to compile gmm module."
             print "But gmm from sklearn will work as well! Using it now!"
         return GMMSet()
     return GMMSet()
コード例 #2
0
 def train(self):
     self.gmmset = GMMSet()
     start_time = time.time()
     for name, feats in self.features.items():
         try:
             self.gmmset.fit_new(feats, name)
         except Exception as e :
             print ("%s failed"%(name))
     print (time.time() - start_time, " seconds")
コード例 #3
0
 def __init__(self,
              ubmfn = None,
              reject_threshold = 10):
     self.features = []
     self.gmmset = GMMSet()
     self.classes = []
     self.reject_threshold = reject_threshold
     if ubmfn is not None:
         self.ubm = self.load(ubmfn)
コード例 #4
0
 def train(self):
     self.gmmset = GMMSet()
     start_time1 = time.time()
     print("Begin to train")
     for name, feats in self.features.items():
         try:
             start_time2 = time.time()
             self.gmmset.fit_new(feats, name)
             print(name," trained",time.time() - start_time2, "seconds" )
         except Exception as e :
             print ("%s failed because of %s"%(name,e))
     print ("Train ",time.time() - start_time1, " seconds")
コード例 #5
0
 def __init__(self):
     self.features = defaultdict(list)
     self.gmmset = GMMSet()
     self.vad = VAD()
コード例 #6
0
 def _get_gmm_set(self):
     return GMMSet()
コード例 #7
0
 def __init__(self):
     self.features = []
     self.gmmset = GMMSet()
     self.classes = []
     self.models = []
コード例 #8
0
 def _get_gmm_set(self):
     from gmmset import GMMSetPyGMM
     if GMMSet is GMMSetPyGMM:
         return GMMSet(ubm=GMM.load(self.UBM_MODEL_FILE))
     else:
         return GMMSet()