Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
11a7e229
Commit
11a7e229
authored
8 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
use the File.load method if possible.
parent
49204f6e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/base/tools/FileSelector.py
+4
-0
4 additions, 0 deletions
bob/bio/base/tools/FileSelector.py
bob/bio/base/tools/preprocessor.py
+7
-3
7 additions, 3 deletions
bob/bio/base/tools/preprocessor.py
with
11 additions
and
3 deletions
bob/bio/base/tools/FileSelector.py
+
4
−
0
View file @
11a7e229
...
...
@@ -110,6 +110,10 @@ 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
.
database
.
original_directory
,
self
.
database
.
database
.
original_extension
)
def
annotation_list
(
self
,
groups
=
None
):
"""
Returns the list of annotations objects.
"""
return
self
.
database
.
all_files
(
groups
=
groups
)
...
...
This diff is collapsed.
Click to expand it.
bob/bio/base/tools/preprocessor.py
+
7
−
3
View file @
11a7e229
...
...
@@ -42,7 +42,7 @@ def preprocess(preprocessor, groups = None, indices = None, allow_missing_files
fs
=
FileSelector
.
instance
()
# get the file lists
data_files
=
fs
.
original_data_list
(
groups
=
groups
)
data_files
,
original_directory
,
original_extension
=
fs
.
original_data_list
_files
(
groups
=
groups
)
preprocessed_data_files
=
fs
.
preprocessed_data_list
(
groups
=
groups
)
# select a subset of keys to iterate
...
...
@@ -60,12 +60,16 @@ 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_name
=
data_files
[
i
]
file_object
=
data_files
[
i
]
file_name
=
file_object
.
make_path
(
original_directory
,
original_extension
)
# check for existence
if
not
utils
.
check_file
(
preprocessed_data_file
,
force
,
1000
):
logger
.
debug
(
"
... Processing original data file
'
%s
'"
,
file_name
)
data
=
preprocessor
.
read_original_data
(
file_name
)
if
hasattr
(
file_object
,
'
load
'
):
data
=
file_object
.
load
(
original_directory
,
original_extension
)
else
:
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
))
...
...
This diff is collapsed.
Click to expand it.
Amir MOHAMMADI
@amohammadi
mentioned in issue
#29 (closed)
·
8 years ago
mentioned in issue
#29 (closed)
mentioned in issue #29
Toggle commit list
Amir MOHAMMADI
@amohammadi
mentioned in commit
d69bcf71
·
8 years ago
mentioned in commit
d69bcf71
mentioned in commit d69bcf71da9bf7b937d6b8ddfb93775db430e86a
Toggle commit list
Amir MOHAMMADI
@amohammadi
mentioned in commit
10f2493c
·
8 years ago
mentioned in commit
10f2493c
mentioned in commit 10f2493cdbfa3d418a91b5da27508e0e41e4c0f5
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment