mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 03:55:21 +00:00
Update image_utils.py
The binary mode of fromstring is deprecated: corrected to frombuffer.
This commit is contained in:
parent
29eac19836
commit
8d68c6e739
@ -127,7 +127,7 @@ def load_image_from_base64(uri: str) -> np.ndarray:
|
|||||||
if file_type not in {"jpeg", "png"}:
|
if file_type not in {"jpeg", "png"}:
|
||||||
raise ValueError(f"Input image can be jpg or png, but it is {file_type}")
|
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_bgr = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
|
||||||
# img_rgb = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB)
|
# img_rgb = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB)
|
||||||
return img_bgr
|
return img_bgr
|
||||||
|
Loading…
x
Reference in New Issue
Block a user