(input_image)
| 6 | |
| 7 | |
| 8 | def photo_2_cartoon(input_image): |
| 9 | p2c = Photo2CartoonPredictor(output_path="/tmp/") |
| 10 | nd_arr = p2c.run(input_image) |
| 11 | image = cv2.cvtColor(nd_arr, cv2.COLOR_RGB2BGR) |
| 12 | return Image.fromarray(image) |
| 13 | |
| 14 | |
| 15 | def base64_encode_img(img): |