def plot_conf_mat(densmap_name):
fig = plt.figure(figsize = (20,20))
plt.clf()
ax = fig.add_subplot(111)
#ax.set_aspect(1)
densmap = np.fromfile(densmap_name, np.float32)
densmap = densmap.reshape(227, 227)
densmap *= 100
densmap[densmap > 1] = 1
res = ax.imshow(densmap, cmap = plt.cm.jet,
interpolation = 'nearest')
plt.savefig('density.jpg')
img = cv2.imread("density.jpg")
img = cv2.resize(img, (227,227))
cv2.imshow("i", img)#
cv2.waitKey(0)
#plt.show()
评论列表
文章目录