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 "ComputeTest.h"
00058
00059 int main(int argc, char* argv[]) {
00060 using namespace std;
00061 using namespace alize;
00062
00063 ConfigChecker cc;
00064 cc.addStringParam("config", false, true, "default config filename");
00065 cc.addStringParam("ndxFilename",true,true, "NDX file listing all verification tests to achieve: first column: test File, all others: models");
00066 cc.addStringParam("outputFilename",true,true, "output scores in this file: 'gender - test model - scores'");
00067 cc.addStringParam("inputWorldFilename",true,true,"model repsresenting the H0 hypothesis to get the LLR");
00068 cc.addStringParam("labelSelectedFrames",true,true,"the segments with this label are used for training the worldmodel");
00069 cc.addStringParam("computeLLKWithTopDistribs",true,true, "PARTIAL/COMPLETE: will compute LLK with topdistribs. COMPLETE: add world LLK to client LLK, PARTIAL: just keeps the topDistrib LLK");
00070 cc.addIntegerParam("topDistribsCount ",false,true,"Number of distrib to approximate complete LLK");
00071 cc.addStringParam("gender",true,true, "M/F: will output the gender in score file");
00072 cc.addStringParam("fileLLR",false,true, "will output a score for the entire file (default true)");
00073 cc.addStringParam("segmentLLR",false,true, "will output a score for each speech segment (default false)");
00074 cc.addStringParam("windowLLR",false,true, "windowLLR: will output a score for each set of windowLLRSize frames. windowLLRDec gives the shift of the window (default false)");
00075 cc.addIntegerParam("windowLLRSize",false,true, "if windowLLR is set, gives the size of the window (default 30)");
00076 cc.addIntegerParam("windowLLRDec",false,true, "if windowLLR is set, gives the shift of the window (default windowLLRSize)");
00077 cc.addBooleanParam("byLabelModel",false,true, "if the parameter is present, we work with a model by client and by cluster (default false)");
00078 cc.addBooleanParam("histoMode",false,true, "if the parameter is present, entropy of LR distrib is used as score (default false)");
00079 cc.addStringParam("channelCompensation",true,true,"if set to [ NAP | FA | JFA | LFA | 'empty'], launch the corresponding channel compensation (default not set)");
00080
00081 try {
00082 CmdLine cmdLine(argc, argv);
00083 if (cmdLine.displayHelpRequired()){
00084 cout << "************************************" << endl;
00085 cout << "********** ComputeTest.exe **********" << endl;
00086 cout << "************************************" << endl;
00087 cout << endl;
00088 cout << "LLR computation for an NDX (NIST format) File" << endl;
00089 cout << "" << endl;
00090 cout << cc.getParamList()<<endl;
00091 return 0;
00092 }
00093 if (cmdLine.displayVersionRequired()){cout <<"ComputeTest - for computing the LLR using nixt style ndx files"<<endl;}
00094 Config tmp;
00095 cmdLine.copyIntoConfig(tmp);
00096 Config config;
00097 if (tmp.existsParam("config")) config.load(tmp.getParam("config"));
00098 cmdLine.copyIntoConfig(config);
00099 cc.check(config);
00100 debug=config.getParam_debug();
00101 if (config.existsParam("verbose"))verbose=config.getParam("verbose").toBool();else verbose=false;
00102 if (verbose) verboseLevel=1;else verboseLevel=0;
00103 if (config.existsParam("verboseLevel"))verboseLevel=config.getParam("verboseLevel").toLong();
00104 if (verboseLevel>0) verbose=true;
00105 if (config.existsParam("byLabelModel"))
00106 ComputeTestByLabel(config);
00107 if (config.existsParam("histoMode"))
00108 ComputeTestHisto(config);
00109
00110 if (config.getParam("channelCompensation")=="JFA"){
00111 if(config.getParam("Scoring") == "FrameByFrame")
00112 ComputeTestJFA(config);
00113 else if(config.getParam("Scoring") == "DotProduct")
00114 ComputeTestDotProduct(config);
00115 }
00116 else if (config.getParam("channelCompensation")=="LFA")
00117 ComputeTestLFA(config);
00118 else if (config.getParam("channelCompensation")=="FA")
00119 ComputeTestFA(config);
00120 else if(config.getParam("channelCompensation")=="NAP")
00121 ComputeTestNAP(config);
00122 else
00123 ComputeTest(config);
00124 }
00125 catch (alize::Exception& e) {cout << e.toString() << endl << cc.getParamList()<< endl;}
00126 return 0;
00127 }