소스 검색

Fix img_arr_to_b64

Kentaro Wada 1 년 전
부모
커밋
2219a1d48f
1개의 변경된 파일1개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 4
      labelme/utils/image.py

+ 1 - 4
labelme/utils/image.py

@@ -35,10 +35,7 @@ def img_pil_to_data(img_pil):
 
 def img_arr_to_b64(img_arr):
     img_data = img_arr_to_data(img_arr)
-    if hasattr(base64, "encodebytes"):
-        img_b64 = base64.encodebytes(img_data)
-    else:
-        img_b64 = base64.encodestring(img_data)
+    img_b64 = base64.b64encode(img_data).decode("utf-8")
     return img_b64