[Fix] make arguments effective in tools/confusion_matrix.py (#1401)

* add an argument for customizing `title' of the output figure

* fix `color_theme' arguments not passing to plot function

Signed-off-by: code14 <mob5566@gmail.com>
This commit is contained in:
Cody Wong 2022-03-21 10:51:27 +08:00 committed by GitHub
parent 1b24ad656f
commit 18859e4de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,10 @@ def parse_args():
'--color-theme', '--color-theme',
default='winter', default='winter',
help='theme of the matrix color map') help='theme of the matrix color map')
parser.add_argument(
'--title',
default='Normalized Confusion Matrix',
help='title of the matrix color map')
parser.add_argument( parser.add_argument(
'--cfg-options', '--cfg-options',
nargs='+', nargs='+',
@ -171,7 +175,9 @@ def main():
confusion_matrix, confusion_matrix,
dataset.CLASSES, dataset.CLASSES,
save_dir=args.save_dir, save_dir=args.save_dir,
show=args.show) show=args.show,
title=args.title,
color_theme=args.color_theme)
if __name__ == '__main__': if __name__ == '__main__':