未验证 提交 d2618d0d 编写于 作者: 郑博培 提交者: GitHub

Update utils.py (#1508)

The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
上级 c8d399db
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册