From 5b195b85118717218a9c039459670888fe65860c Mon Sep 17 00:00:00 2001 From: paopjian <672034519@qq.com> Date: Thu, 16 Jun 2022 13:21:58 +0800 Subject: [PATCH] fix DeprecationWarning, (#6604) DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead --- tools/infer/utility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/infer/utility.py b/tools/infer/utility.py index 1eebc73f..3d9bdee0 100644 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -542,7 +542,7 @@ def text_visual(texts, def base64_to_cv2(b64str): import base64 data = base64.b64decode(b64str.encode('utf8')) - data = np.fromstring(data, np.uint8) + data = np.frombuffer(data, np.uint8) data = cv2.imdecode(data, cv2.IMREAD_COLOR) return data -- GitLab