mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 20:15:21 +00:00
Update functions.py
This commit is contained in:
parent
d3f78558ff
commit
06ca8161bc
@ -103,10 +103,10 @@ def load_image(img):
|
||||
if os.path.isfile(img) is not True:
|
||||
raise ValueError(f"Confirm that {img} exists")
|
||||
|
||||
img = open(img, "rb")
|
||||
chunk = img.read()
|
||||
chunk_arr = np.frombuffer(chunk, dtype=np.uint8)
|
||||
img = cv2.imdecode(chunk_arr, cv2.IMREAD_COLOR)
|
||||
with open(img, "rb") as img:
|
||||
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