-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenerateImage.py
40 lines (32 loc) · 968 Bytes
/
GenerateImage.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 numpy as np
y = np.load('data/groundTruths_diff.npy')
# p = np.load('data/prediction.npy')
print(y.shape)
# print(p.shape)
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
n = 3
rowHeader = ['groundTrue', 'prediction']
colHeader = ['sample {}'.format(col-1) for col in range(1, n+1)]
plt.figure(figsize=(20, 4))
for i in range(1, n+1):
# display original
ax = plt.subplot(2, n, i)
ax.set_title(colHeader[i-1])
if i == 1:
ax.set_ylabel(rowHeader[0], rotation=90, size='large')
plt.imshow(y[i-1])
plt.gray()
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(True)
# display reconstruction
# ax = plt.subplot(2, n, i + n)
# if i == 1:
# ax.set_ylabel(rowHeader[1], rotation=90, size='large')
# plt.imshow(p[i-1])
# plt.gray()
# ax.get_xaxis().set_visible(False)
# ax.get_yaxis().set_visible(True)
# plt.show()
plt.savefig("img/density_32_32.png")