Removes unnessary flatten (#50)

This commit is contained in:
Amir Mousavi 2023-04-11 14:15:54 +08:00 committed by GitHub
parent 6fb0006776
commit 41df4eb287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -31,7 +31,7 @@ class Preprocess(object):
image = Image.open(local_file) image = Image.open(local_file)
image = ImageOps.grayscale(image).resize((28, 28)) 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: def postprocess(self, data: Any, state: dict, collect_custom_statistics_fn=None) -> dict:
# post process the data returned from the model inference engine # post process the data returned from the model inference engine

View File

@ -31,7 +31,7 @@ class Preprocess(object):
image = Image.open(local_file) image = Image.open(local_file)
image = ImageOps.grayscale(image).resize((28, 28)) 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: def postprocess(self, data: Any, state: dict, collect_custom_statistics_fn=None) -> dict:
# post process the data returned from the model inference engine # post process the data returned from the model inference engine