Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.io.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.io.base
Commits
b90e7a0d
Commit
b90e7a0d
authored
3 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Test for lower case version of extensions
parent
7ffd44e0
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!43
Tests extensions against lower case versions
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/io/base/__init__.py
+3
-3
3 additions, 3 deletions
bob/io/base/__init__.py
with
3 additions
and
3 deletions
bob/io/base/__init__.py
+
3
−
3
View file @
b90e7a0d
...
...
@@ -18,7 +18,6 @@ ImageFile.LOAD_TRUNCATED_IMAGES = True
hdf5_extensions
=
[
"
.hdf5
"
,
"
.h5
"
,
"
.hdf
"
,
"
.hdf5
"
,
"
.h5
"
,
"
.hdf
"
,
"
.hdf5
"
]
image_extensions
=
[
"
.jpg
"
,
"
.JPG
"
,
"
.jpeg
"
,
"
.png
"
,
"
.bmp
"
,
...
...
@@ -82,8 +81,8 @@ def open_file(filename):
img
=
img
[:,
:,
0
]
return
img
extension
=
os
.
path
.
splitext
(
filename
)[
1
]
# get the extension
# logger.error(filename
)
# get the extension
extension
=
os
.
path
.
splitext
(
filename
)[
1
].
lower
(
)
if
extension
in
hdf5_extensions
:
with
h5py
.
File
(
filename
,
"
r
"
)
as
f
:
...
...
@@ -102,6 +101,7 @@ def open_file(filename):
if
string_dtype
is
not
None
:
dataset
=
dataset
.
asstr
()
return
dataset
[()]
elif
extension
in
image_extensions
:
from
..image
import
to_bob
...
...
This diff is collapsed.
Click to expand it.
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