From 8d68c6e739c1df00305c65c018ba62b6e17c9b7a Mon Sep 17 00:00:00 2001 From: SachaDee Date: Sat, 26 Oct 2024 23:09:55 -0300 Subject: [PATCH] Update image_utils.py The binary mode of fromstring is deprecated: corrected to frombuffer. --- deepface/commons/image_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepface/commons/image_utils.py b/deepface/commons/image_utils.py index 8d9e058..c2ae1ed 100644 --- a/deepface/commons/image_utils.py +++ b/deepface/commons/image_utils.py @@ -127,7 +127,7 @@ def load_image_from_base64(uri: str) -> np.ndarray: if file_type not in {"jpeg", "png"}: raise ValueError(f"Input image can be jpg or png, but it is {file_type}") - nparr = np.fromstring(decoded_bytes, np.uint8) + nparr = np.frombuffer(decoded_bytes, np.uint8) img_bgr = cv2.imdecode(nparr, cv2.IMREAD_COLOR) # img_rgb = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB) return img_bgr