-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Campbell
committed
Apr 21, 2017
1 parent
01a07cc
commit 35a3fdc
Showing
2 changed files
with
82 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
#!/usr/bin/env python | ||
|
||
import json | ||
|
||
from pyslgr.GMMModel import GMMSAD | ||
from pyslgr.GSV import GSV | ||
from pyslgr.LLSignal import LLSignal | ||
from pyslgr.MFCCFeatures import MFCCFeatures | ||
from pyslgr.FeatPipe import FeatPipe | ||
from pyslgr.sad import XtalkSAD | ||
|
||
if __name__ == "__main__": | ||
|
||
# Load example signal | ||
fn = 'signals/example.sph' | ||
x = LLSignal() | ||
x.load_sph(fn, 0) | ||
|
||
# Initialize feature pipe | ||
mfcc_pipe_fn = "config/sid_mfcc+gmmsad_pipe.json" | ||
with open(mfcc_pipe_fn, 'r') as fp: | ||
pipe_config = json.load(fp) | ||
fpipe = FeatPipe(pipe_config, MFCCFeatures, GMMSAD) | ||
|
||
# Get MFCCFeatures | ||
f = fpipe.process(x) | ||
|
||
# Info | ||
print 'Number of output features: {}'.format(f.num_outfeat()) | ||
# f.save_raw('tmp/gsv_feat.dat') | ||
|
||
# Load in and create GSV | ||
with open('config/gsv.json', 'r') as fp: | ||
config = json.load(fp) | ||
gsv = GSV(config) | ||
|
||
# Now compute a GSV expansion | ||
v = gsv.process(f) | ||
print 'A few elements of GSV expansion: {}'.format(v[0:10]) | ||
print 'GSV expansion dimension = {}'.format(len(v)) | ||
|
||
#!/usr/bin/env python | ||
|
||
import json | ||
|
||
from pyslgr.GMMModel import GMMSAD | ||
from pyslgr.GSV import GSV | ||
from pyslgr.LLSignal import LLSignal | ||
from pyslgr.MFCCFeatures import MFCCFeatures | ||
from pyslgr.FeatPipe import FeatPipe | ||
from pyslgr.sad import XtalkSAD | ||
|
||
if __name__ == "__main__": | ||
|
||
# Load example signal | ||
fn = 'signals/example.sph' | ||
x = LLSignal() | ||
x.load_sph(fn, 0) | ||
|
||
# Initialize feature pipe | ||
mfcc_pipe_fn = "config/sid_mfcc+gmmsad_pipe.json" | ||
with open(mfcc_pipe_fn, 'r') as fp: | ||
pipe_config = json.load(fp) | ||
fpipe = FeatPipe(pipe_config, MFCCFeatures, GMMSAD) | ||
|
||
# Get MFCCFeatures | ||
f = fpipe.process(x) | ||
|
||
# Info | ||
print 'Number of output features: {}'.format(f.num_outfeat()) | ||
# f.save_raw('tmp/gsv_feat.dat') | ||
|
||
# Load in and create GSV | ||
with open('config/gsv.json', 'r') as fp: | ||
config = json.load(fp) | ||
gsv = GSV(config) | ||
|
||
# Now compute a GSV expansion | ||
v = gsv.process(f) | ||
print 'A few elements of GSV expansion: {}'.format(v[0:10]) | ||
print 'GSV expansion dimension = {}'.format(len(v)) | ||
|
||
print 'Done! Successfully completed GSV tests' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
#!/usr/bin/env python | ||
|
||
import json | ||
|
||
from pyslgr.GMMModel import GMMSAD | ||
from pyslgr.iVector import iVector | ||
from pyslgr.LLSignal import LLSignal | ||
from pyslgr.MFCCFeatures import MFCCFeatures | ||
from pyslgr.FeatPipe import FeatPipe | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
|
||
# Load example signal | ||
fn = 'signals/example.sph' | ||
x = LLSignal() | ||
x.load_sph(fn, 0) | ||
|
||
# Initialize feature pipe | ||
mfcc_pipe_fn = "config/sid_mfcc+gmmsad_pipe.json" | ||
with open(mfcc_pipe_fn, 'r') as fp: | ||
pipe_config = json.load(fp) | ||
fpipe = FeatPipe(pipe_config, MFCCFeatures, GMMSAD) | ||
|
||
# Get MFCCFeatures | ||
f = fpipe.process(x) | ||
|
||
# Info | ||
print 'Number of output features: {}'.format(f.num_outfeat()) | ||
# f.save_raw('tmp/ivec_feat.dat') | ||
|
||
# Load in and create ivector | ||
with open('config/ivec.json', 'r') as fp: | ||
config = json.load(fp) | ||
ivec = iVector(config) | ||
|
||
# Now compute an ivector | ||
v = ivec.process(f) | ||
print 'A few elements of iVector: {}'.format(v[0:10]) | ||
print 'iVector dimension = {}'.format(len(v)) | ||
|
||
#!/usr/bin/env python | ||
|
||
import json | ||
|
||
from pyslgr.GMMModel import GMMSAD | ||
from pyslgr.iVector import iVector | ||
from pyslgr.LLSignal import LLSignal | ||
from pyslgr.MFCCFeatures import MFCCFeatures | ||
from pyslgr.FeatPipe import FeatPipe | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
|
||
# Load example signal | ||
fn = 'signals/example.sph' | ||
x = LLSignal() | ||
x.load_sph(fn, 0) | ||
|
||
# Initialize feature pipe | ||
mfcc_pipe_fn = "config/sid_mfcc+gmmsad_pipe.json" | ||
with open(mfcc_pipe_fn, 'r') as fp: | ||
pipe_config = json.load(fp) | ||
fpipe = FeatPipe(pipe_config, MFCCFeatures, GMMSAD) | ||
|
||
# Get MFCCFeatures | ||
f = fpipe.process(x) | ||
|
||
# Info | ||
print 'Number of output features: {}'.format(f.num_outfeat()) | ||
# f.save_raw('tmp/ivec_feat.dat') | ||
|
||
# Load in and create ivector | ||
with open('config/ivec.json', 'r') as fp: | ||
config = json.load(fp) | ||
ivec = iVector(config) | ||
|
||
# Now compute an ivector | ||
v = ivec.process(f) | ||
print 'A few elements of iVector: {}'.format(v[0:10]) | ||
print 'iVector dimension = {}'.format(len(v)) | ||
|
||
print 'Done! Successfully completed iVector tests' |