parser.add_argument('-m','--mindcf',action='store_true',help="If given, minDCF will be computed.")
parser.add_argument('-m','--mindcf',action='store_true',help="If given, minDCF will be computed.")
parser.add_argument('--cost',default=0.99,help='Cost for FAR in minDCF')
parser.add_argument('--cost',default=0.99,help='Cost for FAR in minDCF')
parser.add_argument('-r','--rr',action='store_true',help="If given, the Recognition Rate will be computed.")
parser.add_argument('-r','--rr',action='store_true',help="If given, the Recognition Rate will be computed.")
parser.add_argument('-t','--thresholds',type=float,nargs='+',help="If given, the Recognition Rate will incorporate an Open Set handling, rejecting all scores that are below the given threshold; when multiple thresholds are given, they are applied in the same order as the --dev-files.")
parser.add_argument('-l','--legends',nargs='+',help="A list of legend strings used for ROC, CMC and DET plots; if given, must be the same number than --dev-files.")
parser.add_argument('-l','--legends',nargs='+',help="A list of legend strings used for ROC, CMC and DET plots; if given, must be the same number than --dev-files.")
parser.add_argument('-F','--legend-font-size',type=int,default=18,help="Set the font size of the legends.")
parser.add_argument('-F','--legend-font-size',type=int,default=18,help="Set the font size of the legends.")
parser.add_argument('-P','--legend-position',type=int,help="Set the font size of the legends.")
parser.add_argument('-P','--legend-position',type=int,help="Set the font size of the legends.")
logger.error("If given, the number of --thresholds imust be either 1, or the same as --dev-files (%d), but it is %d",len(args.dev_files),len(args.thresholds))
logger.info("Plotting CMC curves to file '%s'",args.cmc)
logger.info("Plotting CMC curves to file '%s'",args.cmc)
try:
try:
# create a multi-page PDF for the ROC curve
# create a multi-page PDF for the ROC curve
pdf=PdfPages(args.cmc)
pdf=PdfPages(args.cmc)
# create a separate figure for dev and eval
# create a separate figure for dev and eval
pdf.savefig(_plot_cmc(cmcs_dev,colors,args.legends,"CMC curve for development set",args.legend_font_size,args.legend_position))
pdf.savefig(_plot_cmc(cmcs_dev,colors,args.legends,"CMC curve for development set",args.legend_font_size,args.legend_position))
ifargs.eval_files:
ifargs.eval_files:
pdf.savefig(_plot_cmc(cmcs_eval,colors,args.legends,"CMC curve for evaluation set",args.legend_font_size,args.legend_position))
pdf.savefig(_plot_cmc(cmcs_eval,colors,args.legends,"CMC curve for evaluation set",args.legend_font_size,args.legend_position))
pdf.close()
pdf.close()
exceptRuntimeErrorase:
exceptRuntimeErrorase:
raiseRuntimeError("During plotting of ROC curves, the following exception occured:\n%s\nUsually this happens when the label contains characters that LaTeX cannot parse."%e)
raiseRuntimeError("During plotting of ROC curves, the following exception occured:\n%s\nUsually this happens when the label contains characters that LaTeX cannot parse."%e)
ifargs.rr:
ifargs.rr:
logger.info("Computing recognition rate on the development "+("and on the evaluation set"ifargs.eval_fileselse"set"))
logger.info("Computing recognition rate on the development "+("and on the evaluation set"ifargs.eval_fileselse"set"))