1、热力图
import numpy as np
import seaborn as sns
a1=a[0][0]
ax = sns.heatmap(a1,cmap="jet")
plt.show(block=True)
2、矩阵变图片
import cv2
import numpy as np
cv2.imwrite("img_test_show.png", img)
img = cv2.imread("img_test_show.png")
img = cv2.cvtColor(img,cv2.COLOR_BGR2RGB)#格式转换,
cv2.imshow('img', img)
# cv2.waitKey(0)
# cv2.destroyAllWindows()
3、tensor ——> numpy
.detach().cpu().numpy()
4、取出列表中大于某个数的值
[x for x in attr.precisionList if x >0.2]