Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.banca
Commits
dae95772
Commit
dae95772
authored
Dec 06, 2012
by
Laurent EL SHAFEY
Browse files
Update directory structure to the currently distributed one (cf. ticket
#1
)
parent
697ffbb0
Changes
2
Show whitespace changes
Inline
Side-by-side
README.rst
View file @
dae95772
...
...
@@ -2,9 +2,11 @@
BANCA Database
================
This package contains the access API and descriptions for the `BANCA
This package contains the access API and descriptions for the `BANCA English
Database <http://www.ee.surrey.ac.uk/CVSSP/banca/>`_. The actual raw data for
the database should be downloaded from the original URL. This package only
the database should be downloaded from the original URL. This API is only
compatible with the images from the BANCA English database. This package only
contains the `Bob <http://www.idiap.ch/software/bob/>`_ accessor methods to use
the DB directly from python, with our certified protocols.
...
...
xbob/db/banca/create.py
View file @
dae95772
...
...
@@ -10,6 +10,10 @@ import os
from
.models
import
*
def
nodot
(
item
):
"""Can be used to ignore hidden files, starting with the . character."""
return
item
[
0
]
!=
'.'
def
add_files
(
session
,
imagedir
,
verbose
):
"""Add files (and clients) to the BANCA database."""
...
...
@@ -27,10 +31,12 @@ def add_files(session, imagedir, verbose):
if
verbose
:
print
"Adding file '%s'..."
%
(
os
.
path
.
basename
(
filename
).
split
(
'.'
)[
0
],
)
session
.
add
(
File
(
int
(
v
[
0
]),
os
.
path
.
basename
(
filename
).
split
(
'.'
)[
0
],
v
[
4
],
v
[
6
],
session_id
))
file
_list
=
os
.
listdir
(
imagedir
)
subdir
_list
=
filter
(
nodot
,
os
.
listdir
(
imagedir
)
)
client_dict
=
{}
for
subdir
in
subdir_list
:
file_list
=
filter
(
nodot
,
os
.
listdir
(
os
.
path
.
join
(
imagedir
,
subdir
)))
for
filename
in
file_list
:
add_file
(
session
,
os
.
path
.
join
(
imagedir
,
filename
),
client_dict
,
verbose
)
add_file
(
session
,
os
.
path
.
join
(
imagedir
,
filename
),
client_dict
)
def
add_subworlds
(
session
,
verbose
):
"""Adds splits in the world set, based on the client ids"""
...
...
@@ -207,7 +213,7 @@ def add_command(subparsers):
parser
.
add_argument
(
'-v'
,
'--verbose'
,
action
=
'count'
,
help
=
"Do SQL operations in a verbose way"
)
parser
.
add_argument
(
'-D'
,
'--imagedir'
,
action
=
'store'
,
metavar
=
'DIR'
,
default
=
'/idiap/group/
vision/visidiap
/databases/banca/english/images
_gray
'
,
default
=
'/idiap/group/
biometric
/databases/banca/english/images
/images/
'
,
help
=
"Change the relative path to the directory containing the images of the BANCA database (defaults to %(default)s)"
)
parser
.
set_defaults
(
func
=
create
)
#action
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment