(img)
| 32 | |
| 33 | |
| 34 | def preprocess(img): |
| 35 | img = resizeimage.resize_cover(img, [224, 224], validate=False) |
| 36 | img_ycbcr = img.convert('YCbCr') |
| 37 | img_y_0, img_cb, img_cr = img_ycbcr.split() |
| 38 | img_ndarray = np.asarray(img_y_0) |
| 39 | img_4 = np.expand_dims(np.expand_dims(img_ndarray, axis=0), axis=0) |
| 40 | img_5 = img_4.astype(np.float32) / 255.0 |
| 41 | return img_5, img_cb, img_cr |
| 42 | |
| 43 | |
| 44 | def get_image(): |