-
Notifications
You must be signed in to change notification settings - Fork 10
/
plot.py
40 lines (33 loc) · 917 Bytes
/
plot.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
28
29
30
31
32
33
34
35
36
37
38
39
40
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
for package in ['np', 'pytorch', 'tf', 'metadata']:
dfs = []
for ext in ["wav", "mp3", "mp4", "ogg", "flac"]:
try:
dfs.append(
pd.read_pickle("results/benchmark_%s_%s.pickle" % (package, ext))
)
except FileNotFoundError:
continue
df = pd.concat(dfs, ignore_index=True)
sns.set_style("whitegrid")
ordered_exts = df.time.groupby(
df.ext
).mean().sort_values().index.tolist()
fig = plt.figure()
g = sns.catplot(
x="time",
y="ext",
kind='bar',
hue='lib',
order=ordered_exts,
data=df,
height=6.6,
aspect=1,
legend=False
)
g.set(xscale="log")
g.despine(left=True)
plt.legend(loc='upper right')
g.savefig("results/benchmark_%s.png" % package)