diff --git a/bob/io/base/__init__.py b/bob/io/base/__init__.py index 3e4da95af2edb4f75239fe5f0239911091a39090..fd99f4a45ffeeb243817bca227344b44c64a3199 100644 --- a/bob/io/base/__init__.py +++ b/bob/io/base/__init__.py @@ -5,8 +5,6 @@ import h5py import imageio import numpy as np -from ..image import to_bob, to_matplotlib - logger = logging.getLogger(__name__) import os @@ -100,6 +98,7 @@ def open_file(filename): return np.array(f[key]) elif extension in image_extensions: + from ..image import to_bob img = imageio.imread(filename) @@ -143,6 +142,8 @@ def write_file(filename, data, format="pillow"): f["array"] = data elif extension in image_extensions: # Pillow is the format with the best support for all image formats + from ..image import to_matplotlib + imageio.imwrite(filename, to_matplotlib(data), format=format) else: raise RuntimeError(f"Unknown file extension: {extension}") diff --git a/doc/py_api.rst b/doc/py_api.rst index 2373795e8d98312e3ea84f9af57c83d680d101cd..406ac910ee92b2069941e61129d8569ab30d6ac8 100644 --- a/doc/py_api.rst +++ b/doc/py_api.rst @@ -12,7 +12,16 @@ Functions --------- .. autosummary:: - bob.io.base.load bob.io.base.save - bob.io.base.create_directories_safe + bob.io.base.load bob.io.base.vstack_features + bob.io.image.to_matplotlib + bob.io.image.to_bob + bob.io.image.bob_to_pillow + bob.io.image.pillow_to_bob + bob.io.image.opencvbgr_to_bob + bob.io.image.bob_to_opencvbgr + bob.io.image.imshow + +.. automodule:: bob.io.base +.. automodule:: bob.io.image