Skip to content
Snippets Groups Projects
Commit c3e05272 authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Wrap around bob.io.image utils methods in bob.io.stream utils, to centralize...

Wrap around bob.io.image utils methods in bob.io.stream utils, to centralize its usage and make it easier to remove later
parent 919c693e
No related branches found
No related tags found
1 merge request!22Draft: Implements metadata handling for bob.io.stream.Stream and bob.io.stream.StreamFile
Pipeline #60057 failed
......@@ -15,7 +15,7 @@ This module implements several StreamFilters for image processing. The following
import numpy as np
import cv2 as cv
from bob.io.image.utils import opencvbgr_to_bob
from .utils import opencvbgr_to_bob
from .stream import stream_filter, StreamFilter
......
......@@ -12,7 +12,7 @@ import numpy as np
from pkg_resources import resource_filename
from bob.io.image import to_bob
from bob.io.stream.utils import to_bob
from bob.io.stream import StreamFile, Stream
from bob.io.stream.metadata import MetaDatum, MetaData, MetaDataInfo
......
......@@ -7,12 +7,11 @@ Test Units of utils functions.
# ==============================================================================
import numpy as np
from bob.io.image import load
from bob.io.stream.utils import get_axis_size, get_index_list, rotate_data
# ==============================================================================
def test_rotate_data():
"""Unit tests for :func:`~bob.io.stream.utils.rotate_data`."""
......
......@@ -182,3 +182,18 @@ def import_config(config_file_path, config_name="stream_config"):
return module
def to_bob(image):
try:
import bob.io.image
except:
raise ModuleNotFoundError("bob.io.image required for this function")
return bob.io.image.to_bob(image)
def opencvbgr_to_bob(image):
try:
import bob.io.image
except:
raise ModuleNotFoundError("bob.io.image required for this function")
return bob.io.image.opencvbgr_to_bob(image)
......@@ -26,12 +26,11 @@ requirements:
- setuptools {{ setuptools }}
- pip {{ pip }}
- bob.extension
- bob.io.image
- h5py {{ h5py }}
- numpy {{ numpy }}
- scipy {{ scipy }}
- opencv {{ opencv }}
- scikit-image {{ scikit_image }}
- bob.io.image
run:
- python
- setuptools
......@@ -39,7 +38,6 @@ requirements:
- {{ pin_compatible('numpy') }}
- {{ pin_compatible('scipy') }}
- {{ pin_compatible('opencv') }}
- {{ pin_compatible('scikit-image') }}
test:
imports:
......
......@@ -3,5 +3,4 @@ numpy
scipy
h5py
# opencv We need opencv, but the opencv package is broken and can't be installed with pip. Install it with conda.
bob.io.base
bob.io.image
bob.io.image
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment