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') ```