Skip to content

Commit

Permalink
Update image_utils.py
Browse files Browse the repository at this point in the history
The binary mode of fromstring is deprecated: corrected to frombuffer.
  • Loading branch information
sachadee authored Oct 27, 2024
1 parent 29eac19 commit 8d68c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepface/commons/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d68c6e

Please sign in to comment.