在 python 中加载文件,如:
import h5py
filename = 'file.hdf5'
f = h5py.File(filename, 'r')
然后检查它的类型。如果它是一个 numpy 数组,您可以使用 OpenCV 或 Pillow。如果不是,只需使用f = np.array(f)
.
开放式简历:
cv.imshow('text', f)
cv.waitKey(0)
cv.destroyAllWindows()
枕头:
Image.fromarray(f).show()