Commit 4f1ae620 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch...

Merge branch '86-in-evaluate-py-there-is-no-way-of-using-both-4-and-5-column-score-files' into 'master'

Resolve "In evaluate.py, there is no way of using both 4- and 5-column score files"

Closes #86

See merge request !90
parents 1fd65888 2baef7ca
Pipeline #11742 passed with stages
in 10 minutes and 6 seconds
......@@ -58,7 +58,6 @@ def command_line_arguments(command_line_parameters):
parser.add_argument('-E', '--epc', help = "If given, EPC curves will be plotted into the given pdf file. For this plot --eval-files is mandatory.")
parser.add_argument('-M', '--min-far-value', type=float, default=1e-4, help = "Select the minimum FAR value used in ROC plots; should be a power of 10.")
parser.add_argument('-L', '--far-line-at', type=float, help = "If given, draw a veritcal line at this FAR value in the ROC plots.")
parser.add_argument('--parser', default = '4column', choices = ('4column', '5column'), help="The style of the resulting score files. The default fits to the usual output of score files.")
# add verbose option
bob.core.log.add_command_line_option(parser)
......@@ -244,17 +243,16 @@ def main(command_line_parameters=None):
'#bcbd22', '#17becf']
if args.criterion or args.roc or args.det or args.epc or args.cllr or args.mindcf:
score_parser = {'4column' : bob.measure.load.split_four_column, '5column' : bob.measure.load.split_five_column}[args.parser]
# First, read the score files
logger.info("Loading %d score files of the development set", len(args.dev_files))
scores_dev = [score_parser(os.path.join(args.directory, f)) for f in args.dev_files]
scores_dev = [bob.measure.load.split(os.path.join(args.directory, f)) for f in args.dev_files]
# remove nans
scores_dev = [get_fta(s) for s in scores_dev]
if args.eval_files:
logger.info("Loading %d score files of the evaluation set", len(args.eval_files))
scores_eval = [score_parser(os.path.join(args.directory, f)) for f in args.eval_files]
scores_eval = [bob.measure.load.split(os.path.join(args.directory, f)) for f in args.eval_files]
# remove nans
scores_eval = [get_fta(s) for s in scores_eval]
......@@ -379,10 +377,9 @@ def main(command_line_parameters=None):
if args.cmc or args.rr:
logger.info("Loading CMC data on the development " + ("and on the evaluation set" if args.eval_files else "set"))
cmc_parser = {'4column' : bob.measure.load.cmc_four_column, '5column' : bob.measure.load.cmc_five_column}[args.parser]
cmcs_dev = [cmc_parser(os.path.join(args.directory, f)) for f in args.dev_files]
cmcs_dev = [bob.measure.load.cmc(os.path.join(args.directory, f)) for f in args.dev_files]
if args.eval_files:
cmcs_eval = [cmc_parser(os.path.join(args.directory, f)) for f in args.eval_files]
cmcs_eval = [bob.measure.load.cmc(os.path.join(args.directory, f)) for f in args.eval_files]
if args.cmc:
logger.info("Plotting CMC curves to file '%s'", args.cmc)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment