From c844a13b07f050dc25006df6a6e0942bc1b3296b Mon Sep 17 00:00:00 2001 From: Amir Mousavi Date: Tue, 4 Apr 2023 20:28:04 -0700 Subject: [PATCH] Removes unnessary flatten --- examples/keras/preprocess.py | 2 +- examples/pytorch/preprocess.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/keras/preprocess.py b/examples/keras/preprocess.py index 8d69acf..efb1545 100644 --- a/examples/keras/preprocess.py +++ b/examples/keras/preprocess.py @@ -31,7 +31,7 @@ def preprocess(self, body: Union[bytes, dict], state: dict, collect_custom_stati image = Image.open(local_file) image = ImageOps.grayscale(image).resize((28, 28)) - return np.array([np.array(image).flatten()]) + return np.array([np.array(image)]) def postprocess(self, data: Any, state: dict, collect_custom_statistics_fn=None) -> dict: # post process the data returned from the model inference engine diff --git a/examples/pytorch/preprocess.py b/examples/pytorch/preprocess.py index 8d69acf..efb1545 100644 --- a/examples/pytorch/preprocess.py +++ b/examples/pytorch/preprocess.py @@ -31,7 +31,7 @@ def preprocess(self, body: Union[bytes, dict], state: dict, collect_custom_stati image = Image.open(local_file) image = ImageOps.grayscale(image).resize((28, 28)) - return np.array([np.array(image).flatten()]) + return np.array([np.array(image)]) def postprocess(self, data: Any, state: dict, collect_custom_statistics_fn=None) -> dict: # post process the data returned from the model inference engine