00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #include <iostream>
00056 #include <liatools.h>
00057 #include <EigenChannel.h>
00058
00059 using namespace alize;
00060 using namespace std;
00061
00062 int main(int argc, char* argv[]) {
00063 ConfigChecker cc;
00064 try {
00065
00066 cc.addStringParam("ndxFilename",true,true,"NDX of multiple GMM speaker recordings");
00067 cc.addStringParam("inputWorldFilename",true,true,"the world model file");
00068 cc.addIntegerParam("nbIt",true,true,"number of ml it");
00069 cc.addStringParam("saveMatrixFormat",true,true,"matrix format: DB (binary) or DT (ascii)");
00070 cc.addStringParam("loadMatrixFormat",true,true,"matrix format: DB (binary) or DT (ascii)");
00071
00072 cc.addBooleanParam("loadAccs",false,true,"if true do not compute UBM stats, load matrices");
00073 cc.addIntegerParam("computeLLK",false,true,"optional: nb of files where LLK is computed");
00074 cc.addStringParam("initChannelMatrix",false,true,"init Channel Matrix (DM compatibility)");
00075 cc.addIntegerParam("channelMatrixRank",false,true,"final rank of channel matrix (DM compatibility)");
00076 cc.addFloatParam("regulationFactor",false,true,"map tau (DM compatibility)");
00077 cc.addStringParam("initEigenChannelMatrix",false,true,"init EigenChannel Matrix if not loaded");
00078 cc.addStringParam("loadInitChannelMatrix",false,true,"filename to load init Matrix ");
00079 cc.addStringParam("eigenChannelMatrix",false,true,"filename to save EigenVoice Matrix ");
00080 cc.addIntegerParam("eigenChannelRank",false,true,"final rank of EigenVoice matrix");
00081 cc.addStringParam("eigenChannelMode",false,true,"compute eigenChannel matrix for JFA or LFA paradigm WARNING if not set call DM version");
00082 cc.addStringParam("channelMatrix",false,true,"filename to save Channel Matrix ");
00083 cc.addStringParam("eigenVoiceMatrix",false,true,"name of the EigenVoice Matrix");
00084 cc.addBooleanParam("checkLLK",false,true,"if true do compute the likelihood of training data after each iteration");
00085 cc.addBooleanParam("saveInitChannelMatrix",false,true,"if true save the matrix used for initialisation");
00086 cc.addBooleanParam("saveAllECMatrices",false,true,"if true save the matrices after each iteration");
00087
00088
00089 CmdLine cmdLine(argc, argv);
00090 if (cmdLine.displayHelpRequired()){
00091 cout << "****************************************" << endl;
00092 cout << "********** EigenChannel.exe ************" << endl;
00093 cout << "****************************************" << endl;
00094 cout << endl;
00095 cout << "Evaluate Channel Matrix from speakers data" << endl;
00096 cout <<endl<<cc.getParamList()<<endl;
00097 return 0;
00098 }
00099 if (cmdLine.displayVersionRequired()){
00100 cout <<"Version 2.0 ALIZE Package"<<endl;
00101 }
00102
00103 Config tmp;
00104 cmdLine.copyIntoConfig (tmp);
00105 Config config;
00106 if (tmp.existsParam("config")) config.load(tmp.getParam("config"));
00107 cmdLine.copyIntoConfig(config);
00108 cc.check(config);
00109 debug=config.getParam_debug();
00110 if (config.existsParam("verbose"))verbose=config.getParam("verbose").toBool();else verbose=false;
00111 if (verbose) verboseLevel=1;else verboseLevel=0;
00112 if (config.existsParam("verboseLevel"))verboseLevel=config.getParam("verboseLevel").toLong();
00113 if (verboseLevel>0) verbose=true;
00114 if (cmdLine.displayHelpRequired()) {cout << cc.getParamList() << endl;}
00115
00116 if(config.getParam("eigenChannelMode") == "JFA") EigenChannelJFA(config);
00117 else if(config.getParam("eigenChannelMode") == "LFA") EigenChannelLFA(config);
00118 else if(config.getParam("eigenChannelMode") == "") EigenChannel(config);
00119 else{
00120 cout<<"Error : wrong eigenChannelMode parameter, please chose JFA or LFA"<<endl;
00121 }
00122 }
00123 catch (Exception& e) {cout << e.toString() << cc.getParamList() << endl;}
00124 if (debug) {
00125 }
00126 return 0;
00127 }