-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_runtime.py
More file actions
135 lines (107 loc) · 3.79 KB
/
plot_runtime.py
File metadata and controls
135 lines (107 loc) · 3.79 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import os, sys, math, random, time, csv, copy, argparse
import matplotlib
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
import cv2
fig = None
ax1 = None
ax2 = None
ax3 = None
def plot_overall():
# max_vals = [
# 94.03,
# 98.06,
# 94.43,
# ]
# vals = [
# [3.6, 4.53, 10.01, 53.98, 14.16],
# [4.05, 13.29, 19.0, 27.93, 26.31],
# [4.57, 5.05, 11.04, 50.25, 16.29],
# ]
scene_names = ['Dining Room', 'Table', 'Living Room']
for i, _ in enumerate(vals):
vals[i].append(max_vals[i]-sum(vals[i]))
vals = np.array(vals).T
labels = ['Frustum Culling', 'LTC Integration', 'Lights Preproc', 'Occluder Preproc', 'Set Difference', 'Misc']
colors = ['tomato', 'sandybrown', 'wheat', 'khaki', 'lightgreen', 'lightgrey']
ind = np.arange(len(max_vals))
ax1.set_xticks(ind)
ax1.set_xticklabels(scene_names)
for i in range(vals.shape[0]):
if i == 0:
ax1.bar(ind, vals[i, :], 0.35, color=colors[i])
else:
ax1.bar(ind, vals[i, :], 0.35, bottom=np.sum(vals[:i, :], axis=0), color=colors[i])
ax1.set_ylabel('Relative Time')
ax1.set_xlabel('Scenes')
ax1.legend(labels=labels)
def plot_lights():
# max_vals = [
# 10.01,
# 19.0,
# 11.04,
# ]
# vals = [
# [0.27, 0.24, 2.66, 0.89, 3.68],
# [0.63, 0.57, 2.09, 6.04, 5.51],
# [0.42, 0.21, 1.81, 3.28, 2.97],
# ]
scene_names = ['Dining Room', 'Table', 'Living Room']
for i, _ in enumerate(vals):
vals[i].append(max_vals[i]-sum(vals[i]))
vals = np.array(vals).T
labels = ['Clip To Horizon', 'Local Shading Transform', 'Project To Plane', 'Silhouette Comp.', 'Sort Edges', 'Misc']
colors = ['tomato', 'sandybrown', 'wheat', 'khaki', 'lightgreen', 'lightgrey']
ind = np.arange(len(max_vals))
ax2.set_xticks(ind)
ax2.set_xticklabels(scene_names)
for i in range(vals.shape[0]):
if i == 0:
ax2.bar(ind, vals[i, :], 0.35, color=colors[i])
else:
ax2.bar(ind, vals[i, :], 0.35, bottom=np.sum(vals[:i, :], axis=0), color=colors[i])
ax2.set_ylabel('Relative Time')
ax2.set_xlabel('Light Preprocess')
ax2.legend(labels=labels)
def plot_occluder():
# max_vals = [
# 53.98,
# 27.93,
# 50.25,
# ]
# vals = [
# [4.04, 1.38, 10.77, 14.96, 15.65],
# [1.11, 0.99, 3.56, 9.64, 7.01],
# [1.96, 1.27, 9.03, 15.8, 14.5],
# ]
scene_names = ['Dining Room', 'Table', 'Living Room']
for i, _ in enumerate(vals):
vals[i].append(max_vals[i]-sum(vals[i]))
vals = np.array(vals).T
labels = ['Clip To Horizon', 'Local Shading Transform', 'Project To Plane', 'Silhouette Comp.', 'Sort Edges', 'Misc']
colors = ['tomato', 'sandybrown', 'wheat', 'khaki', 'lightgreen', 'lightgrey']
ind = np.arange(len(max_vals))
ax3.set_xticks(ind)
ax3.set_xticklabels(scene_names)
for i in range(vals.shape[0]):
if i == 0:
ax3.bar(ind, vals[i, :], 0.35, color=colors[i])
else:
ax3.bar(ind, vals[i, :], 0.35, bottom=np.sum(vals[:i, :], axis=0), color=colors[i])
ax3.set_ylabel('Relative Time')
ax3.set_xlabel('Occluder Preprocess')
ax3.legend(labels=labels)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
args = parser.parse_args()
nrows = 1
ncols = 3
fig = plt.figure(figsize=(16, 8))
ax1 = fig.add_subplot(nrows, ncols, 1)
ax2 = fig.add_subplot(nrows, ncols, 2)
ax3 = fig.add_subplot(nrows, ncols, 3)
plot_overall()
plot_lights()
plot_occluder()
plt.show()