From 9b693a86a381e0ae4ec82dec0ebe37a84dcfbf05 Mon Sep 17 00:00:00 2001 From: Harshit Jain Date: Sat, 13 Nov 2021 16:38:48 +0530 Subject: [PATCH] update on line no. 34 of resizing the input (new image) As we drag and drop new image with different dimension, if the input image is not resized it will give error "value error" of expected shape and found shape. --- api/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/main.py b/api/main.py index 33447e3..5343add 100644 --- a/api/main.py +++ b/api/main.py @@ -31,7 +31,7 @@ async def ping(): return "Hello, I am alive" def read_file_as_image(data) -> np.ndarray: - image = np.array(Image.open(BytesIO(data))) + image = np.array(Image.open(BytesIO(data)).resize(256, 256)) return image @app.post("/predict")