forked from Caffe-MPI/Caffe-MPI.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_top1.py
27 lines (21 loc) · 827 Bytes
/
plot_top1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
import sys
import argparse
try:
import seaborn as sns
sns.set(style="dark")
except ImportError:
pass
import matplotlib.pyplot as plt
from common_plot import parse_files, plot_accuracy
TOP_K = 1
parser = argparse.ArgumentParser(description='Plot top {}% from log files.'.format(TOP_K))
parser.add_argument('-v', dest='value_at_hover', action='store_true',
help="Display plot values at cursor hover")
parser.add_argument('-s', dest='separate', action='store_true',
help="plot each log separately, don't concatenate them")
parser.add_argument('log', nargs = '*', help = "list of log files.")
args = parser.parse_args()
data = parse_files(files=args.log, top_k=TOP_K, separate=args.separate)
plt = plot_accuracy(top_k=TOP_K, data=data, value_at_hover=args.value_at_hover)
plt.show()