Skip to content
Snippets Groups Projects
Commit 4364dd69 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[data.stare] Make loader pickle-able

parent a57676d0
No related branches found
No related tags found
No related merge requests found
Pipeline #41192 passed
...@@ -44,21 +44,22 @@ _root_path = bob.extension.rc.get( ...@@ -44,21 +44,22 @@ _root_path = bob.extension.rc.get(
) )
def _make_loader(root_path): class _make_loader:
#hack to get testing on the CI working fine for this dataset #hack to get testing on the CI working fine for this dataset
def _raw_data_loader(sample): def __init__(self, root_path):
self.root_path = root_path
def __raw_data_loader__(self, sample):
return dict( return dict(
data=load_pil_rgb(os.path.join(root_path, sample["data"])), data=load_pil_rgb(os.path.join(self.root_path, sample["data"])),
label=load_pil_1(os.path.join(root_path, sample["label"])), label=load_pil_1(os.path.join(self.root_path, sample["label"])),
) )
def _loader(context, sample): def __call__(self, context, sample):
# "context" is ignored in this case - database is homogeneous # "context" is ignored in this case - database is homogeneous
# we returned delayed samples to avoid loading all images at once # we returned delayed samples to avoid loading all images at once
return make_delayed(sample, _raw_data_loader) return make_delayed(sample, self.__raw_data_loader__)
return _loader
def _make_dataset(root_path): def _make_dataset(root_path):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment