Skip to content

Commit 68eda66

Browse files
Migrate tensorflow_graphics/io to Python 3.
PiperOrigin-RevId: 361944235
1 parent bf513f9 commit 68eda66

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tensorflow_graphics/io/exr.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@
2222
import Imath
2323
import numpy as np
2424
import OpenEXR
25+
from six.moves import range
26+
from six.moves import zip
2527

2628

2729
_np_to_exr = {
2830
np.float16: Imath.PixelType.HALF,
2931
np.float32: Imath.PixelType.FLOAT,
3032
np.uint32: Imath.PixelType.UINT,
3133
}
32-
_exr_to_np = dict(zip(_np_to_exr.values(), _np_to_exr.keys()))
34+
_exr_to_np = dict(list(zip(list(_np_to_exr.values()), list(_np_to_exr.keys()))))
3335

3436

3537
def channels_to_ndarray(exr, channel_names):

tensorflow_graphics/io/tests/exr_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
# pylint: disable=c-extension-no-member
1717

18+
from __future__ import absolute_import
19+
from __future__ import division
20+
from __future__ import print_function
21+
1822
import collections
1923
import tempfile
2024

@@ -23,6 +27,7 @@
2327
import numpy as np
2428
import OpenEXR
2529

30+
from six.moves import range
2631
from tensorflow_graphics.io import exr
2732
from tensorflow_graphics.util import test_case
2833

0 commit comments

Comments
 (0)