Convert an ndarray to PIL Image.
(x, mode='YCbCr')
| 27 | |
| 28 | |
| 29 | def array_to_img(x, mode='YCbCr'): |
| 30 | """Convert an ndarray to PIL Image.""" |
| 31 | x = np.squeeze(x) |
| 32 | return Image.fromarray(x.astype('uint8'), mode=mode) |
| 33 | |
| 34 | |
| 35 | def img_to_array(img, data_format=None): |
no outgoing calls
no test coverage detected