Commit ac41e56a authored by Manuel Günther's avatar Manuel Günther

Merge branch 'issue_20' into 'master'

Fixes verbosity; Fixes CMC plot (closes #20)

See merge request !21
parents 271b5897 63f4557a
Pipeline #5210 passed with stages
in 11 minutes and 12 seconds
......@@ -33,10 +33,8 @@ Examples:
import os
import sys
import logging
__logging_format__='[%(levelname)s] %(message)s'
logging.basicConfig(format=__logging_format__)
logger = logging.getLogger('bob')
import bob.core
logger = bob.core.log.setup("bob.measure")
from .eval_threshold import apthres
......@@ -63,8 +61,8 @@ def main(user_input=None):
)
# Sets-up logging
if args['--verbose'] == 1: logging.getLogger().setLevel(logging.INFO)
elif args['--verbose'] >= 2: logging.getLogger().setLevel(logging.DEBUG)
verbosity = int(args['--verbose'])
bob.core.log.set_verbosity_level(logger, verbosity)
# handles threshold validation
try:
......
......@@ -47,10 +47,8 @@ Examples:
import os
import sys
import logging
__logging_format__='[%(levelname)s] %(message)s'
logging.basicConfig(format=__logging_format__)
logger = logging.getLogger('bob')
import bob.core
logger = bob.core.log.setup("bob.measure")
def apthres(neg, pos, thres):
......@@ -108,8 +106,8 @@ def main(user_input=None):
)
# Sets-up logging
if args['--verbose'] == 1: logging.getLogger().setLevel(logging.INFO)
elif args['--verbose'] >= 2: logging.getLogger().setLevel(logging.DEBUG)
verbosity = int(args['--verbose'])
bob.core.log.set_verbosity_level(logger, verbosity)
# validates criterion
valid_criteria = ('eer', 'mhter', 'mwer')
......
......@@ -32,6 +32,9 @@ from __future__ import print_function
import os
import sys
import bob.core
logger = bob.core.log.setup("bob.measure")
def main(user_input=None):
......@@ -55,8 +58,8 @@ def main(user_input=None):
)
# Sets-up logging
if args['--verbose'] == 1: logging.getLogger().setLevel(logging.INFO)
elif args['--verbose'] >= 2: logging.getLogger().setLevel(logging.DEBUG)
verbosity = int(args['--verbose'])
bob.core.log.set_verbosity_level(logger, verbosity)
# Validates rank
if args['--rank'] is not None:
......@@ -90,7 +93,11 @@ def main(user_input=None):
# compute recognition rate
from .. import recognition_rate
rr = recognition_rate(data, args['--rank'])
if args['--rank'] is not None:
rr = recognition_rate(data, rank=args['--rank'])
else:
rr = recognition_rate(data)
print("Recognition rate for score file %s is %3.2f%%" % (args['<scores>'],
rr * 100))
......
......@@ -56,10 +56,8 @@ Options:
import os
import sys
import logging
__logging_format__='[%(levelname)s] %(message)s'
logging.basicConfig(format=__logging_format__)
logger = logging.getLogger('bob')
import bob.core
logger = bob.core.log.setup("bob.measure")
class Result:
......@@ -197,8 +195,8 @@ def main(user_input=None):
)
# Sets-up logging
if args['--verbose'] == 1: logging.getLogger().setLevel(logging.INFO)
elif args['--verbose'] >= 2: logging.getLogger().setLevel(logging.DEBUG)
verbosity = int(args['--verbose'])
bob.core.log.set_verbosity_level(logger, verbosity)
# checks sort-key
valid_sort_keys = 'nonorm_dev nonorm_eval ztnorm_dev ztnorm_eval dir'.split()
......
Markdown is supported
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