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
00057 #include "ComputeNorm.h"
00058 #include "liatools.h"
00059
00060 using namespace std;
00061 using namespace alize;
00062
00063 int main(int argc, char* argv[])
00064 {
00065 ConfigChecker cc;
00066 cc.addStringParam("testNistFile",true, true,"target_seg score file");
00067 cc.addStringParam("normType",true, true,"tnorm|znorm|ztnorm|tznorm, the normalization method (ztnorm is outputing both tnorm and ztnorm scores, tznorm both tznorm and znorm scores)");
00068 cc.addStringParam("tnormNistFile",false,true,"imp_seg score file, impostor scores used for tnorm and ztnorm");
00069 cc.addStringParam("znormNistFile",false,true,"target_imp score file, impostor scores used for znorm and ztnorm");
00070 cc.addStringParam("ztnormNistFile",false,true,"imp_imp score file, impostor scores used for ztnorm and tznorm");
00071 cc.addStringParam("outputFileBaseName",true, true,"the output file(s) basename");
00072 cc.addStringParam("znormFilesExtension",false, true,"znorm output file extension (default='.znorm'");
00073 cc.addStringParam("ztnormFilesExtension",false, true,"ztnorm output file extension (default='.znorm'");
00074 cc.addStringParam("tnormFilesExtension",false, true,"tnorm output file extension (default='.tnorm'");
00075 cc.addStringParam("tznormFilesExtension",false, true,"tznorm output file extension (default='.tznorm'");
00076 cc.addStringParam("cohortFilePath",false, true,"cohort files path, for selectTargetDependentCohortInFile");
00077 cc.addStringParam("cohortFileExt",false, true,"cohort files extension, for selectTargetDependentCohortInFile");
00078 cc.addIntegerParam("maxIdNb",false, true,"Max target speakers - use to fix the max number of znorm score distributions (default=1000)");
00079 cc.addIntegerParam("maxSegNb",false, true,"Max test segments - use to fix the max number of tnorm score distributions (default=1000)");
00080 cc.addIntegerParam("maxScoreDistribNb",false, true,"Max scores per distribution - use to fix the max number of score in a distribution (default=1000)");
00081 cc.addIntegerParam("fieldGender",false, true,"The field for gender in the nist file format (default=0)");
00082 cc.addIntegerParam("fieldName",false, true,"The field for gender in the nist file format (default=1)");
00083 cc.addIntegerParam("fieldDecision",false, true,"The field for gender in the nist file format (default=2)");
00084 cc.addIntegerParam("fieldSeg",false, true,"The field for gender in the nist file format (default=3)");
00085 cc.addIntegerParam("fieldLLR",false, true,"The field for gender in the nist file format (default=4)");
00086 cc.addStringParam("impostorIDList",false, true,"If the option is set, it limits the used impostor scores to the one of the given list");
00087 cc.addIntegerParam("meanMode",false,true,"Score distrib mean computation mode. 0 classical, 1 median (default 0)");
00088 cc.addFloatParam("percentH",false,true,"% of higest scores discarded (default 0)");
00089 cc.addFloatParam("percentL",false,true,"% of lowest scores discarded (default 0)");
00090
00091 try {
00092 CmdLine cmdLine(argc, argv);
00093 if (cmdLine.displayHelpRequired()){
00094 cout << "************************************" << endl;
00095 cout << "********** ComputeNorm.exe *************" << endl;
00096 cout << "************************************" << endl;
00097 cout << endl;
00098 cout << "Apply Z-T-ZT or ZT Norm to a Score File" << endl<< "ztnorm includes tnorm"<<endl;
00099 cout <<endl<<cc.getParamList()<<endl;
00100 return 0;
00101 }
00102 if (cmdLine.displayVersionRequired()){
00103 cout <<"Version 3"<<endl;
00104 }
00105 Config tmp;
00106 cmdLine.copyIntoConfig(tmp);
00107 Config config;
00108 if (tmp.existsParam("config")) config.load(tmp.getParam("config"));
00109 cmdLine.copyIntoConfig(config);
00110 cc.check(config);
00111 debug=config.getParam_debug();
00112 if (config.existsParam("verbose"))verbose=config.getParam("verbose").toBool();else verbose=false;
00113 if (verbose) verboseLevel=1;else verboseLevel=0;
00114 if (config.existsParam("verboseLevel"))verboseLevel=config.getParam("verboseLevel").toLong();
00115 if (verboseLevel>0) verbose=true;
00116
00117 if(!config.existsParam("znormFilesExtension")) config.setParam("znormFilesExtension",".znorm");
00118 if(!config.existsParam("tnormFilesExtension")) config.setParam("tnormFilesExtension",".tnorm");
00119 if(!config.existsParam("ztnormFilesExtension")) config.setParam("ztnormFilesExtension",".ztnorm");
00120 if(!config.existsParam("tznormFilesExtension")) config.setParam("tznormFilesExtension",".tznorm");
00121 if(!config.existsParam("maxIdNb")) config.setParam("maxIdNb","1000");
00122 if(!config.existsParam("maxSegNb")) config.setParam("maxSegNb","1000");
00123 if(!config.existsParam("maxScoreDistribNb")) config.setParam("maxScoreDistribNb","1000");
00124 if(!config.existsParam("fieldGender")) config.setParam("fieldGender","0");
00125 if(!config.existsParam("fieldName")) config.setParam("fieldName","1");
00126 if(!config.existsParam("fieldDecision")) config.setParam("fieldDecision","2");
00127 if(!config.existsParam("fieldSeg")) config.setParam("fieldSeg","3");
00128 if(!config.existsParam("fieldLLR")) config.setParam("fieldLLR","4");
00129 if(!config.existsParam("meanMode")) config.setParam("meanMode","0");
00130 if(!config.existsParam("percentH")) config.setParam("percentH","0.0");
00131 if(!config.existsParam("percentL")) config.setParam("percentL","0.0");
00132
00133
00134
00135
00136
00137 ComputeNorm(config);
00138 }
00139 catch (alize::Exception& e) {cout << e.toString() << endl << cc.getParamList()<< endl;}
00140 return 0;
00141 }
00142
00143