The error shows 1.
The error shows 2.
(Predicted as RGB image, turned out distorted as black)
Reason: Use matplotlib.image to read in the image array. Note that the array read here is of float32 type, the range is 0-1, and the PIL.Image data is uinit8 type, and the range is 0-255
(can be analyzed according to python PIL image processing - jujua - Blog Park (cnblogs.com) )
Change plan:
image=Image.fromarray(image)——>image=Image.fromarray(np.uint8(image*255))