From 59b0335719dab22d4f1d51173b7cb9e9dd63472f Mon Sep 17 00:00:00 2001 From: hawor Date: Tue, 27 Feb 2024 14:07:12 +0800 Subject: [PATCH] =?UTF-8?q?infer=20bug=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extensions/sd_EasyPhoto/scripts/easyphoto_infer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/sd_EasyPhoto/scripts/easyphoto_infer.py b/extensions/sd_EasyPhoto/scripts/easyphoto_infer.py index e7e35167..3860681c 100644 --- a/extensions/sd_EasyPhoto/scripts/easyphoto_infer.py +++ b/extensions/sd_EasyPhoto/scripts/easyphoto_infer.py @@ -1772,7 +1772,7 @@ def easyphoto_infer_forward( if not os.path.exists(output_path): os.makedirs(output_path) print(f"Save template {str(template_idx + 1)} to S3.") - image = decode_image_from_base64jpeg(output_image) + image = decode_image_from_numpy(np.array(output_image)) output_img_path = os.path.join(os.path.join(output_path), f"{user_ids[0]}_" + str(template_idx + 1)) @@ -2915,8 +2915,6 @@ def post_single_image(image_path, user_id, unique_id): ) -def decode_image_from_base64jpeg(base64_image): - image_bytes = base64.b64decode(base64_image) - np_arr = np.frombuffer(image_bytes, np.uint8) +def decode_image_from_numpy(np_arr): image = cv2.imdecode(np_arr, cv2.IMREAD_COLOR) return image \ No newline at end of file