File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ def encode(image):
99 Returns:
1010 A `io.BytesIO` containing the LBX encoded image.
1111 """
12- pass
12+ return image
1313
1414def decode (lbx ):
1515 """Decodes a `io.BytesIO` with LBX encoded data into a `PIL.Image`.
@@ -20,4 +20,4 @@ def decode(lbx):
2020 Returns:
2121 A `PIL.Image` of the decoded data.
2222 """
23- pass
23+ return lbx
Original file line number Diff line number Diff line change 1- from PIL import Image
1+ from io import BytesIO
2+
23import labelbox .lbx as lbx
4+ import numpy as np
5+ from PIL import Image
36
47def test_identity (datadir ):
5- im = Image . open (datadir .join ('PNG_transparency_demonstration_2.png' ))
6- print ( im )
7- assert np .array (lbx .decode (lbx .encode (im ))) == np .array (im )
8+ with open (datadir .join ('PNG_transparency_demonstration_2.png' ), 'rb' ) as f :
9+ im = Image . open ( BytesIO ( f . read ()) )
10+ assert np .all ( np . array (lbx .decode (lbx .encode (im ))) == np .array (im ) )
811
You can’t perform that action at this time.
0 commit comments