1- #!/usr/bin/env python
2-
3- import json
4-
5- from pyslgr .GMMModel import GMMSAD
6- from pyslgr .GSV import GSV
7- from pyslgr .LLSignal import LLSignal
8- from pyslgr .MFCCFeatures import MFCCFeatures
9- from pyslgr .FeatPipe import FeatPipe
10- from pyslgr .sad import XtalkSAD
11-
12- if __name__ == "__main__" :
13-
14- # Load example signal
15- fn = 'signals/example.sph'
16- x = LLSignal ()
17- x .load_sph (fn , 0 )
18-
19- # Initialize feature pipe
20- mfcc_pipe_fn = "config/sid_mfcc+gmmsad_pipe.json"
21- with open (mfcc_pipe_fn , 'r' ) as fp :
22- pipe_config = json .load (fp )
23- fpipe = FeatPipe (pipe_config , MFCCFeatures , GMMSAD )
24-
25- # Get MFCCFeatures
26- f = fpipe .process (x )
27-
28- # Info
29- print 'Number of output features: {}' .format (f .num_outfeat ())
30- # f.save_raw('tmp/gsv_feat.dat')
31-
32- # Load in and create GSV
33- with open ('config/gsv.json' , 'r' ) as fp :
34- config = json .load (fp )
35- gsv = GSV (config )
36-
37- # Now compute a GSV expansion
38- v = gsv .process (f )
39- print 'A few elements of GSV expansion: {}' .format (v [0 :10 ])
40- print 'GSV expansion dimension = {}' .format (len (v ))
41-
1+ #!/usr/bin/env python
2+
3+ import json
4+
5+ from pyslgr .GMMModel import GMMSAD
6+ from pyslgr .GSV import GSV
7+ from pyslgr .LLSignal import LLSignal
8+ from pyslgr .MFCCFeatures import MFCCFeatures
9+ from pyslgr .FeatPipe import FeatPipe
10+ from pyslgr .sad import XtalkSAD
11+
12+ if __name__ == "__main__" :
13+
14+ # Load example signal
15+ fn = 'signals/example.sph'
16+ x = LLSignal ()
17+ x .load_sph (fn , 0 )
18+
19+ # Initialize feature pipe
20+ mfcc_pipe_fn = "config/sid_mfcc+gmmsad_pipe.json"
21+ with open (mfcc_pipe_fn , 'r' ) as fp :
22+ pipe_config = json .load (fp )
23+ fpipe = FeatPipe (pipe_config , MFCCFeatures , GMMSAD )
24+
25+ # Get MFCCFeatures
26+ f = fpipe .process (x )
27+
28+ # Info
29+ print 'Number of output features: {}' .format (f .num_outfeat ())
30+ # f.save_raw('tmp/gsv_feat.dat')
31+
32+ # Load in and create GSV
33+ with open ('config/gsv.json' , 'r' ) as fp :
34+ config = json .load (fp )
35+ gsv = GSV (config )
36+
37+ # Now compute a GSV expansion
38+ v = gsv .process (f )
39+ print 'A few elements of GSV expansion: {}' .format (v [0 :10 ])
40+ print 'GSV expansion dimension = {}' .format (len (v ))
41+
4242 print 'Done! Successfully completed GSV tests'
0 commit comments