Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
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.face
Commits
3da3a026
There was a problem fetching the pipeline summary.
Commit
3da3a026
authored
7 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Implemented fix for IJB-A original image I/O
parent
d6f75c9a
No related branches found
No related tags found
1 merge request
!34
Resolve "Reading original data from IJB-A"
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/database/ijba.py
+16
-3
16 additions, 3 deletions
bob/bio/face/database/ijba.py
with
16 additions
and
3 deletions
bob/bio/face/database/ijba.py
+
16
−
3
View file @
3da3a026
...
...
@@ -12,6 +12,7 @@
from
.database
import
FaceBioFile
from
bob.bio.base.database
import
BioDatabase
,
BioFileSet
import
os
import
bob.io.image
class
IJBABioFile
(
FaceBioFile
):
...
...
@@ -19,9 +20,18 @@ class IJBABioFile(FaceBioFile):
super
(
IJBABioFile
,
self
).
__init__
(
client_id
=
f
.
client_id
,
path
=
f
.
path
,
file_id
=
f
.
id
)
self
.
f
=
f
def
make_path
(
self
,
directory
,
extension
):
# add file ID to the path, so that a unique path is generated (there might be several identities in each physical file)
return
str
(
os
.
path
.
join
(
directory
or
''
,
self
.
path
+
"
-
"
+
str
(
self
.
client_id
)
+
(
extension
or
''
)))
def
load
(
self
,
directory
,
extension
=
None
,
add_client_id
=
False
):
return
bob
.
io
.
image
.
load
(
self
.
make_path
(
directory
,
self
.
f
.
extension
,
add_client_id
))
def
make_path
(
self
,
directory
,
extension
,
add_client_id
=
True
):
if
add_client_id
:
# add client ID to the path, so that a unique path is generated
# (there might be several identities in each physical file)
path
=
"
%s-%s%s
"
%
(
self
.
path
,
self
.
client_id
,
extension
or
''
)
else
:
# do not add the client ID to be able to obtain the original image file
path
=
"
%s%s
"
%
(
self
.
path
,
self
.
client_id
,
extension
or
''
)
return
str
(
os
.
path
.
join
(
directory
or
''
,
path
))
class
IJBABioFileSet
(
BioFileSet
):
...
...
@@ -73,3 +83,6 @@ class IJBABioDatabase(BioDatabase):
def
client_id_from_model_id
(
self
,
model_id
,
group
=
'
dev
'
):
return
self
.
_db
.
get_client_id_from_model_id
(
model_id
)
def
original_file_names
(
self
,
files
):
return
[
f
.
make_path
(
self
.
original_directory
,
f
.
f
.
extension
,
False
)
for
f
in
files
]
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