From 4f6c1b8c74526acc537957ae50b92f9bf395577b Mon Sep 17 00:00:00 2001 From: Stephen Matthews <29377502+stephengmatthews@users.noreply.github.com> Date: Sat, 23 Jul 2022 07:09:59 +0100 Subject: [PATCH] Rename bytes to bytes_enc --- .../04_Supervisely_Format_objects.md | 8 ++++---- data-organization/supervisely-format.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data-organization/Annotation-JSON-format/04_Supervisely_Format_objects.md b/data-organization/Annotation-JSON-format/04_Supervisely_Format_objects.md index 0eaa0354..dfd08603 100644 --- a/data-organization/Annotation-JSON-format/04_Supervisely_Format_objects.md +++ b/data-organization/Annotation-JSON-format/04_Supervisely_Format_objects.md @@ -344,8 +344,8 @@ def mask_2_base64(mask): img_pil.putpalette([0,0,0,255,255,255]) bytes_io = io.BytesIO() img_pil.save(bytes_io, format='PNG', transparency=0, optimize=0) - bytes = bytes_io.getvalue() - return base64.b64encode(zlib.compress(bytes)).decode('utf-8') + bytes_enc = bytes_io.getvalue() + return base64.b64encode(zlib.compress(bytes_enc)).decode('utf-8') ``` Example: @@ -366,8 +366,8 @@ def mask_2_base64(mask): img_pil.putpalette([0,0,0,255,255,255]) bytes_io = io.BytesIO() img_pil.save(bytes_io, format='PNG', transparency=0, optimize=0) - bytes = bytes_io.getvalue() - return base64.b64encode(zlib.compress(bytes)).decode('utf-8') + bytes_enc = bytes_io.getvalue() + return base64.b64encode(zlib.compress(bytes_enc)).decode('utf-8') example_np_bool = np.ones((3, 3), dtype=bool) example_np_bool[1][1] = False diff --git a/data-organization/supervisely-format.md b/data-organization/supervisely-format.md index 91b66ad9..fb025d7f 100644 --- a/data-organization/supervisely-format.md +++ b/data-organization/supervisely-format.md @@ -386,6 +386,6 @@ def mask_2_base64(mask): img_pil.putpalette([0,0,0,255,255,255]) bytes_io = io.BytesIO() img_pil.save(bytes_io, format='PNG', transparency=0, optimize=0) - bytes = bytes_io.getvalue() - return base64.b64encode(zlib.compress(bytes)).decode('utf-8') + bytes_enc = bytes_io.getvalue() + return base64.b64encode(zlib.compress(bytes_enc)).decode('utf-8') ```