Browse Source

v3.0: from_buffer

Tinger 2 years ago
parent
commit
b0a65f9770
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/util.py

+ 1 - 1
utils/util.py

@@ -65,7 +65,7 @@ def str_include(str_long: "str", str_short: "str") -> "bool":
 
 
 
 
 def read_img(content: "str") -> "np.ndarray":
 def read_img(content: "str") -> "np.ndarray":
-    return cv2.imdecode(np.fromstring(content, np.uint8), 1)  # noqa
+    return cv2.imdecode(np.frombuffer(content, np.uint8), 1)  # noqa
 
 
 
 
 def rot_img(img: "np.ndarray") -> "list[np.ndarray]":
 def rot_img(img: "np.ndarray") -> "list[np.ndarray]":