forked from silencemao/detect-cell-edge-use-unet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_predict.py
36 lines (28 loc) · 857 Bytes
/
test_predict.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
import matplotlib.pyplot as plt
import numpy as np
# mydata = dataProcess(512,512)
imgs_test = np.load('../deform/npydata/imgs_test.npy')
# myunet = myUnet()
#
# model = myunet.get_unet()
#
# model.load_weights('unet.hdf5')
#
# imgs_mask_test = model.predict(imgs_test, verbose=1)
#
# np.save('imgs_mask_test.npy', imgs_mask_test)
imgs_test_predict = np.load('imgs_mask_test.npy')
print(imgs_test.shape, imgs_test_predict.shape)
n = 2
plt.figure(figsize=(20, 4))
for i in range(20, 22):
plt.gray()
ax = plt.subplot(2, n, (i-20)+1)
plt.imshow(imgs_test[i].reshape(512, 512))
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
ax = plt.subplot(2, n, (i - 20) + n + 1)
plt.imshow(imgs_test_predict[i].reshape(512, 512))
ax.get_xaxis().set_visible(False)
ax.get_yaxis().set_visible(False)
plt.show()