Skip to content

Commit

Permalink
Fix img_arr_to_b64
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Nov 28, 2023
1 parent 543177f commit 6c68d79
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions labelme/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 6c68d79

Please sign in to comment.