def write_img(img, fpath, cmax=None):
from scipy import misc
if cmax is None:
cmax = 255
if np.max(img) <= 1.0 and img.dtype == float:
cmax = 1.0
img_conv = misc.toimage(img, cmin=0, cmax=cmax)
img_conv.save(fpath)
# json
评论列表
文章目录