提交 325706fc 编写于 作者: M MRXLT

File2Image support py3

上级 bd42658a
......@@ -296,7 +296,10 @@ class File2Image(object):
pass
def __call__(self, img_path):
fin = open(img_path)
if py_version == 2:
fin = open(img_path)
else:
fin = open(img_path, "rb")
sample = fin.read()
data = np.fromstring(sample, np.uint8)
img = cv2.imdecode(data, cv2.IMREAD_COLOR)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册