From 10f2493cdbfa3d418a91b5da27508e0e41e4c0f5 Mon Sep 17 00:00:00 2001 From: Amir Mohammadi <183.amir@gmail.com> Date: Thu, 1 Sep 2016 21:19:15 +0200 Subject: [PATCH] Revert "use the File.load method if possible." This reverts commit 11a7e2292f46229d39da2dd0161eb7073788f4a4. --- bob/bio/base/tools/FileSelector.py | 4 ---- bob/bio/base/tools/preprocessor.py | 10 +++------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/bob/bio/base/tools/FileSelector.py b/bob/bio/base/tools/FileSelector.py index 16592e26..8a623d3e 100644 --- a/bob/bio/base/tools/FileSelector.py +++ b/bob/bio/base/tools/FileSelector.py @@ -110,10 +110,6 @@ class FileSelector: """Returns the list of original data that can be used for preprocessing.""" return self.database.original_file_names(self.database.all_files(groups=groups)) - def original_data_list_files(self, groups = None): - """Returns the list of original data that can be used for preprocessing.""" - return (self.database.all_files(groups=groups), self.database.original_directory, self.database.original_extension) - def annotation_list(self, groups = None): """Returns the list of annotations objects.""" return self.database.all_files(groups=groups) diff --git a/bob/bio/base/tools/preprocessor.py b/bob/bio/base/tools/preprocessor.py index 86ec390c..01dea478 100644 --- a/bob/bio/base/tools/preprocessor.py +++ b/bob/bio/base/tools/preprocessor.py @@ -42,7 +42,7 @@ def preprocess(preprocessor, groups = None, indices = None, allow_missing_files fs = FileSelector.instance() # get the file lists - data_files, original_directory, original_extension = fs.original_data_list_files(groups=groups) + data_files = fs.original_data_list(groups=groups) preprocessed_data_files = fs.preprocessed_data_list(groups=groups) # select a subset of keys to iterate @@ -60,16 +60,12 @@ def preprocess(preprocessor, groups = None, indices = None, allow_missing_files # iterate over the selected files for i in index_range: preprocessed_data_file = preprocessed_data_files[i] - file_object = data_files[i] - file_name = file_object.make_path(original_directory, original_extension) + file_name = data_files[i] # check for existence if not utils.check_file(preprocessed_data_file, force, 1000): logger.debug("... Processing original data file '%s'", file_name) - if hasattr(file_object, 'load'): - data = file_object.load(original_directory, original_extension) - else: - data = preprocessor.read_original_data(file_name) + data = preprocessor.read_original_data(file_name) # create output directory before reading the data file (is sometimes required, when relative directories are specified, especially, including a .. somewhere) bob.io.base.create_directories_safe(os.path.dirname(preprocessed_data_file)) -- GitLab