Patches on demographic datasets

parent 1ffa161f
......@@ -93,7 +93,14 @@ class MEDSDatabase(CSVDatasetZTNorm):
"""
def __init__(self, protocol, annotation_type="eyes-center", fixed_positions=None):
def __init__(
self,
protocol,
annotation_type="eyes-center",
fixed_positions=None,
dataset_original_directory=rc.get("bob.db.meds.directory"),
dataset_original_extension=".jpg",
):
# Downloading model if not exists
urls = MEDSDatabase.urls()
......@@ -101,6 +108,10 @@ class MEDSDatabase(CSVDatasetZTNorm):
"meds.tar.gz", urls, file_hash="3b01354d4c170672ac14120b80dace75"
)
dataset_original_directory = (
dataset_original_directory if dataset_original_directory is not None else ""
)
super().__init__(
name="meds",
dataset_protocol_path=filename,
......@@ -108,10 +119,8 @@ class MEDSDatabase(CSVDatasetZTNorm):
csv_to_sample_loader=make_pipeline(
CSVToSampleLoaderBiometrics(
data_loader=bob.io.base.load,
dataset_original_directory=rc["bob.db.meds.directory"]
if rc["bob.db.meds.directory"]
else "",
extension=".jpg",
dataset_original_directory=dataset_original_directory,
extension=dataset_original_extension,
),
EyesAnnotations(),
),
......
......@@ -57,13 +57,23 @@ class MorphDatabase(CSVDatasetZTNorm):
"""
def __init__(self, protocol, annotation_type="eyes-center", fixed_positions=None):
def __init__(
self,
protocol,
annotation_type="eyes-center",
fixed_positions=None,
dataset_original_directory=rc.get("bob.db.morph.directory"),
dataset_original_extension=".JPG",
):
# Downloading model if not exists
urls = MorphDatabase.urls()
filename = get_file(
"morph.tar.gz", urls, file_hash="9efa1ff13ef6984ebfcf86f1b1f58873"
)
dataset_original_directory = (
dataset_original_directory if dataset_original_directory is not None else ""
)
super().__init__(
name="morph",
......@@ -72,10 +82,8 @@ class MorphDatabase(CSVDatasetZTNorm):
csv_to_sample_loader=make_pipeline(
CSVToSampleLoaderBiometrics(
data_loader=bob.io.base.load,
dataset_original_directory=rc["bob.db.morph.directory"]
if rc["bob.db.morph.directory"]
else "",
extension=".JPG",
dataset_original_directory=dataset_original_directory,
extension=dataset_original_extension,
),
EyesAnnotations(),
),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment