From b9cb0471f59d2cd75cc81bd17829f2570af9633e 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 d27aec63..bc095baa 100644 --- a/tools/infer/utility.py +++ b/tools/infer/utility.py @@ -587,7 +587,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