我不明白为什么 plt.show()
什么都不显示
import matplotlib.pyplot as plt
plt.figure()
plt.imshow(image_np_with_detections)
plt.show()
我使用了 plt.imsave("test2.png",image_np_with_detections)
,它确实使用了 plt.show()
我已经看到了 this answer which does not solve my issue,因为我只使用了一次 plt.show()
。
我错过了什么?
答案 0 :(得分:0)
尝试使用 plt.imread 而不是 plt.imsave。这对我有用
img = plt.imread(r"C:\temp\image.png")
plt.imshow(img)