From d2618d0db4d46a0230f373e8894ded284fe250fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E5=8D=9A=E5=9F=B9?= <58476312+zbp-xxxp@users.noreply.github.com> Date: Mon, 5 Jul 2021 18:07:01 +0800 Subject: [PATCH] Update utils.py (#1508) The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead --- .../image/text_recognition/chinese_ocr_db_crnn_server/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/image/text_recognition/chinese_ocr_db_crnn_server/utils.py b/modules/image/text_recognition/chinese_ocr_db_crnn_server/utils.py index 5a90b27d..c5bf34d0 100644 --- a/modules/image/text_recognition/chinese_ocr_db_crnn_server/utils.py +++ b/modules/image/text_recognition/chinese_ocr_db_crnn_server/utils.py @@ -172,6 +172,6 @@ def sorted_boxes(dt_boxes): def base64_to_cv2(b64str): 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