mirror of
https://github.com/serengil/deepface.git
synced 2025-06-08 12:35:22 +00:00
Fix bug with unicode filenames
This commit is contained in:
parent
1626b93b08
commit
d3f78558ff
@ -103,7 +103,12 @@ def load_image(img):
|
||||
if os.path.isfile(img) is not True:
|
||||
raise ValueError(f"Confirm that {img} exists")
|
||||
|
||||
return cv2.imread(img)
|
||||
img = open(img, "rb")
|
||||
chunk = img.read()
|
||||
chunk_arr = np.frombuffer(chunk, dtype=np.uint8)
|
||||
img = cv2.imdecode(chunk_arr, cv2.IMREAD_COLOR)
|
||||
|
||||
return img
|
||||
|
||||
|
||||
# --------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user