From aa4e4abe3093e31835d28276e5a8951566d13c91 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Sat, 29 Apr 2023 15:27:30 +0100 Subject: [PATCH] imread restored --- deepface/commons/functions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/deepface/commons/functions.py b/deepface/commons/functions.py index d04d71c..6b02df3 100644 --- a/deepface/commons/functions.py +++ b/deepface/commons/functions.py @@ -104,14 +104,14 @@ def load_image(img): raise ValueError(f"Confirm that {img} exists") # For reading images with unicode names - with open(img, "rb") as img_f: - chunk = img_f.read() - chunk_arr = np.frombuffer(chunk, dtype=np.uint8) - img = cv2.imdecode(chunk_arr, cv2.IMREAD_COLOR) - - return img + # with open(img, "rb") as img_f: + # chunk = img_f.read() + # chunk_arr = np.frombuffer(chunk, dtype=np.uint8) + # img = cv2.imdecode(chunk_arr, cv2.IMREAD_COLOR) + # return img + # This causes troubles when reading files with non english names - # return cv2.imread(img) + return cv2.imread(img) # --------------------------------------------------