-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest1.py
59 lines (42 loc) · 884 Bytes
/
test1.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import cv2
import torch
import numpy as np
import matplotlib.pyplot as plt
'''
a = torch.load("s_out_1.pt")
print("______")
print(a.shape)
print("total pp: ", a.sum())
b = a.cpu().data.numpy()
print("___________")
print(b[0][0])
b = b[0][0]
print("___________")
print("max: ", np.max(b))
print("min: ", np.min(b))
b = np.asarray(b)
print("b shape: ", b.shape)
_c = 0.206455
for k in range(54):
for l in range(87):
if b[k][l] - _c > 0.01:
print("true")
'''
teacher = torch.load("t_out_0.pt")
print(teacher.shape)
# print(teacher)
h = teacher[0][0]
print("teacher: \n", h)
print("_____________")
print(h.shape)
h = h.cpu().detach().numpy()
print(h.shape)
print(h)
_min = np.min(h)
_max = np.max(h)
h = h - _min
h = h/_max*255
map = np.array(h, dtype=np.uint8)
map = cv2.applyColorMap(map, cv2.COLORMAP_JET)
plt.imshow(map)
plt.show()