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
1b420252
There was a problem fetching the pipeline summary.
Commit
1b420252
authored
7 years ago
by
Tiago de Freitas Pereira
Browse files
Options
Downloads
Plain Diff
Merge branch '25-reading-original-data-from-ijb-a' into 'master'
Resolve "Reading original data from IJB-A" Closes
#25
See merge request
!34
parents
d6f75c9a
f11caa2a
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 @
1b420252
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
from
.database
import
FaceBioFile
from
.database
import
FaceBioFile
from
bob.bio.base.database
import
BioDatabase
,
BioFileSet
from
bob.bio.base.database
import
BioDatabase
,
BioFileSet
import
os
import
os
import
bob.io.image
class
IJBABioFile
(
FaceBioFile
):
class
IJBABioFile
(
FaceBioFile
):
...
@@ -19,9 +20,18 @@ 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
)
super
(
IJBABioFile
,
self
).
__init__
(
client_id
=
f
.
client_id
,
path
=
f
.
path
,
file_id
=
f
.
id
)
self
.
f
=
f
self
.
f
=
f
def
make_path
(
self
,
directory
,
extension
):
def
load
(
self
,
directory
,
extension
=
None
,
add_client_id
=
False
):
# add file ID to the path, so that a unique path is generated (there might be several identities in each physical file)
return
bob
.
io
.
image
.
load
(
self
.
make_path
(
directory
,
self
.
f
.
extension
,
add_client_id
))
return
str
(
os
.
path
.
join
(
directory
or
''
,
self
.
path
+
"
-
"
+
str
(
self
.
client_id
)
+
(
extension
or
''
)))
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
,
extension
or
''
)
return
str
(
os
.
path
.
join
(
directory
or
''
,
path
))
class
IJBABioFileSet
(
BioFileSet
):
class
IJBABioFileSet
(
BioFileSet
):
...
@@ -73,3 +83,6 @@ class IJBABioDatabase(BioDatabase):
...
@@ -73,3 +83,6 @@ class IJBABioDatabase(BioDatabase):
def
client_id_from_model_id
(
self
,
model_id
,
group
=
'
dev
'
):
def
client_id_from_model_id
(
self
,
model_id
,
group
=
'
dev
'
):
return
self
.
_db
.
get_client_id_from_model_id
(
model_id
)
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