Commit c4e8273d authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

First commit

parent 9d31bdf1
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Elie Khoury <Elie.Khoury@idiap.ch>
# @date: Thu Aug 22 17:43:04 CEST 2013
#
# Copyright (C) 2012-2014 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
Details about the Voxforge database can be found here:
http://www.voxforge.org/
"""
from .query import Database
from bob.db.verification.filelist.models import File, Client
def get_config():
"""Returns a string containing the configuration information.
"""
import pkg_resources
packages = pkg_resources.require(__name__)
this = packages[0]
deps = packages[1:]
retval = "%s: %s (%s)\n" % (this.key, this.version, this.location)
retval += " - python dependencies:\n"
for d in deps: retval += " - %s: %s (%s)\n" % (d.key, d.version, d.location)
return retval.strip()
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Laurent El Shafey <laurent.el-shafey@idiap.ch>
# Fri Aug 23 16:51:41 CEST 2013
#
# Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""Commands the CASIA NIR-VIS 2.0 database can respond to.
"""
import os
import sys
from bob.db.base.driver import Interface as BaseInterface
def dumplist(args):
"""Dumps lists of files based on your criteria"""
from .query import Database
db = Database()
r = db.objects(
purposes=args.purpose,
groups=args.group,
)
output = sys.stdout
if args.selftest:
from bob.db.base.utils import null
output = null()
for f in r:
output.write('%s\n' % f.make_path(directory=args.directory,extension=args.extension))
return 0
def checkfiles(args):
"""Checks existence of files based on your criteria"""
from .query import Database
db = Database()
r = db.objects()
# go through all files, check if they are available on the filesystem
good = []
bad = []
for f in r:
if os.path.exists(f.make_path(args.directory, args.extension)): good.append(f)
else: bad.append(f)
# report
output = sys.stdout
if args.selftest:
from bob.db.base.utils import null
output = null()
if bad:
for f in bad:
output.write('Cannot find file "%s"\n' % f.make_path(args.directory, args.extension))
output.write('%d files (out of %d) were not found at "%s"\n' % \
(len(bad), len(r), args.directory))
return 0
class Interface(BaseInterface):
def name(self):
return 'voxforge'
def version(self):
import pkg_resources # part of setuptools
return pkg_resources.require('bob.db.%s' % self.name())[0].version
def files(self):
return ()
def type(self):
return 'text'
def add_commands(self, parser):
from . import __doc__ as docs
subparsers = self.setup_parser(parser,
"Voxforge database", docs)
import argparse
# the "dumplist" action
parser = subparsers.add_parser('dumplist', help=dumplist.__doc__)
parser.add_argument('-d', '--directory', default='', help="if given, this path will be prepended to every entry returned.")
parser.add_argument('-e', '--extension', default='', help="if given, this extension will be appended to every entry returned.")
parser.add_argument('-u', '--purpose', help="if given, this value will limit the output files to those designed for the given purposes.", choices=('enrol', 'probe', ''))
parser.add_argument('-g', '--group', help="if given, this value will limit the output files to those belonging to a particular protocolar group.", choices=('dev', 'eval', 'world', 'optional_world_1', 'optional_world_2', ''))
parser.add_argument('--self-test', dest="selftest", action='store_true', help=argparse.SUPPRESS)
parser.set_defaults(func=dumplist) #action
# the "checkfiles" action
parser = subparsers.add_parser('checkfiles', help=checkfiles.__doc__)
parser.add_argument('-l', '--list-directory', required=True, help="The directory which contains the file lists.")
parser.add_argument('-d', '--directory', dest="directory", default='', help="if given, this path will be prepended to every entry returned.")
parser.add_argument('-e', '--extension', dest="extension", default='', help="if given, this extension will be appended to every entry returned.")
parser.add_argument('--self-test', dest="selftest", action='store_true', help=argparse.SUPPRESS)
parser.set_defaults(func=checkfiles) #action
Mapping between the casia format and bob.db format
norm -- train_world.lst = nir_train_dev.txt + vis_train_dev.txt
dev ------ for_models.lst = vis_gallery_dev.txt
|-- for_probes.lst = nir_probe_dev.txt
|
|
test1 |-- for_models.lst = vis_gallery_1.txt
|-- for_probes.lst = nir_probe_1.txt
test2 |-- for_models.lst = vis_gallery_2.txt
. |-- for_probes.lst = nir_probe_2.txt
.
.
.
.
test10 |-- for_models.lst = vis_gallery_10.txt
|-- for_probes.lst = nir_probe_10.txt
s1/VIS/00081/008 00081 00081
s1/VIS/00091/009 00091 00091
s3/VIS/20480/005 20480 20480
s2/VIS/10186/003 10186 10186
s3/VIS/20492/002 20492 20492
s2/VIS/10077/004 10077 10077
s2/VIS/10260/006 10260 10260
s4/VIS/30786/002 30786 30786
s1/VIS/00186/004 00186 00186
s3/VIS/20405/001 20405 20405
s3/VIS/20393/004 20393 20393
s3/VIS/20378/003 20378 20378
s2/VIS/10076/002 10076 10076
s3/VIS/20351/002 20351 20351
s2/VIS/10024/001 10024 10024
s3/VIS/20338/004 20338 20338
s1/VIS/00134/004 00134 00134
s2/VIS/10014/005 10014 10014
s2/VIS/10116/001 10116 10116
s1/VIS/00114/004 00114 00114
s2/VIS/10223/006 10223 10223
s3/VIS/20343/006 20343 20343
s2/VIS/10062/001 10062 10062
s2/VIS/10272/004 10272 10272
s2/VIS/10088/003 10088 10088
s3/VIS/20477/003 20477 20477
s1/VIS/00092/010 00092 00092
s2/VIS/10250/002 10250 10250
s4/VIS/30747/004 30747 30747
s2/VIS/10066/004 10066 10066
s2/VIS/10037/003 10037 10037
s3/VIS/20387/006 20387 20387
s1/VIS/00155/011 00155 00155
s2/VIS/10265/003 10265 10265
s2/VIS/10251/003 10251 10251
s3/VIS/20352/006 20352 20352
s1/VIS/00078/004 00078 00078
s2/VIS/10053/001 10053 10053
s1/VIS/00167/010 00167 00167
s1/VIS/00111/006 00111 00111
s3/VIS/20408/005 20408 20408
s4/VIS/30597/003 30597 30597
s2/VIS/10140/003 10140 10140
s2/VIS/10148/003 10148 10148
s2/VIS/10131/005 10131 10131
s1/VIS/00059/002 00059 00059
s3/VIS/20489/003 20489 20489
s1/VIS/00031/005 00031 00031
s2/VIS/10308/002 10308 10308
s3/VIS/20451/002 20451 20451
s1/VIS/00187/009 00187 00187
s3/VIS/20494/004 20494 20494
s2/VIS/10084/001 10084 10084
s1/VIS/00099/008 00099 00099
s2/VIS/10309/005 10309 10309
s2/VIS/10281/002 10281 10281
s2/VIS/10054/001 10054 10054
s4/VIS/30783/002 30783 30783
s2/VIS/10207/005 10207 10207
s2/VIS/10229/002 10229 10229
s2/VIS/10025/001 10025 10025
s4/VIS/30750/003 30750 30750
s1/VIS/00043/001 00043 00043
s3/VIS/20384/004 20384 20384
s3/VIS/20403/002 20403 20403
s2/VIS/10208/004 10208 10208
s1/VIS/00119/008 00119 00119
s3/VIS/20360/001 20360 20360
s2/VIS/10110/005 10110 10110
s4/VIS/30599/001 30599 30599
s2/VIS/10160/002 10160 10160
s1/VIS/00028/006 00028 00028
s4/VIS/30773/002 30773 30773
s1/VIS/00035/003 00035 00035
s2/VIS/10058/004 10058 10058
s2/VIS/10284/002 10284 10284
s2/VIS/10065/001 10065 10065
s1/VIS/00096/006 00096 00096
s2/VIS/10049/004 10049 10049
s1/VIS/00116/003 00116 00116
s1/VIS/00033/010 00033 00033
s2/VIS/10175/004 10175 10175
s3/VIS/20467/001 20467 20467
s3/VIS/20410/003 20410 20410
s1/VIS/00171/005 00171 00171
s1/VIS/00004/010 00004 00004
s1/VIS/00127/004 00127 00127
s1/VIS/00008/003 00008 00008
s3/VIS/20433/001 20433 20433
s1/VIS/00094/006 00094 00094
s2/VIS/10100/006 10100 10100
s2/VIS/10277/003 10277 10277
s2/VIS/10046/001 10046 10046
s4/VIS/30749/002 30749 30749
s2/VIS/10150/001 10150 10150
s2/VIS/10211/001 10211 10211
s2/VIS/10226/006 10226 10226
s2/VIS/10067/006 10067 10067
s2/VIS/10080/004 10080 10080
s2/VIS/10004/005 10004 10004
s1/VIS/00120/004 00120 00120
s2/VIS/10168/006 10168 10168
s4/VIS/30771/003 30771 30771
s2/VIS/10034/003 10034 10034
s1/VIS/00079/004 00079 00079
s2/VIS/00071/002 00071 00071
s2/VIS/10197/002 10197 10197
s4/VIS/30480/002 30480 30480
s1/VIS/00070/008 00070 00070
s2/VIS/10279/001 10279 10279
s2/VIS/10052/005 10052 10052
s1/VIS/00150/008 00150 00150
s2/VIS/00016/007 00016 00016
s1/VIS/00082/004 00082 00082
s3/VIS/20321/002 20321 20321
s2/VIS/10124/004 10124 10124
s1/VIS/00183/008 00183 00183
s2/VIS/10092/005 10092 10092
s2/VIS/10276/003 10276 10276
s1/VIS/00169/005 00169 00169
s3/VIS/20392/005 20392 20392
s1/VIS/00041/002 00041 00041
s3/VIS/20445/004 20445 20445
s2/VIS/10274/004 10274 10274
s1/VIS/00095/001 00095 00095
s2/VIS/10298/003 10298 10298
s2/VIS/10231/001 10231 10231
s2/VIS/10198/004 10198 10198
s2/VIS/10305/002 10305 10305
s1/VIS/00104/005 00104 00104
s2/VIS/10012/002 10012 10012
s4/VIS/30787/001 30787 30787
s2/VIS/10158/003 10158 10158
s3/VIS/20455/002 20455 20455
s1/VIS/00199/004 00199 00199
s1/VIS/00084/002 00084 00084
s2/VIS/10193/005 10193 10193
s3/VIS/20456/002 20456 20456
s3/VIS/20444/006 20444 20444
s2/VIS/10031/006 10031 10031
s2/VIS/10048/004 10048 10048
s1/VIS/00190/005 00190 00190
s3/VIS/20413/005 20413 20413
s3/VIS/20395/003 20395 20395
s1/VIS/00017/002 00017 00017
s2/VIS/10107/003 10107 10107
s4/VIS/30754/003 30754 30754
s1/VIS/00006/010 00006 00006
s2/VIS/10239/001 10239 10239
s3/VIS/20483/006 20483 20483
s1/VIS/00036/001 00036 00036
s2/VIS/10102/003 10102 10102
s1/VIS/00175/002 00175 00175
s3/VIS/20349/003 20349 20349
s1/VIS/00075/004 00075 00075
s2/VIS/10022/002 10022 10022
s3/VIS/20414/003 20414 20414
s1/VIS/00118/001 00118 00118
s3/VIS/20462/005 20462 20462
s2/VIS/10230/003 10230 10230
s2/VIS/00178/002 00178 00178
s1/VIS/00153/008 00153 00153
s2/VIS/10303/001 10303 10303
s3/VIS/20372/004 20372 20372
s2/VIS/10218/004 10218 10218
s1/VIS/00196/009 00196 00196
s4/VIS/30785/001 30785 30785
s3/VIS/20404/002 20404 20404
s1/VIS/00038/001 00038 00038
s2/VIS/10286/006 10286 10286
s1/VIS/00090/010 00090 00090
s3/VIS/20475/002 20475 20475
s1/VIS/00032/007 00032 00032
s1/VIS/00018/003 00018 00018
s1/VIS/00145/010 00145 00145
s1/VIS/00124/005 00124 00124
s2/VIS/10136/002 10136 10136
s2/VIS/10213/002 10213 10213
s3/VIS/20484/004 20484 20484
s3/VIS/20385/004 20385 20385
s1/VIS/00087/007 00087 00087
s2/VIS/10302/004 10302 10302
s1/VIS/00001/001 00001 00001
s4/VIS/30596/001 30596 30596
s3/VIS/20476/001 20476 20476
s1/VIS/00195/002 00195 00195
s2/VIS/10040/011 10040 10040
s3/VIS/20336/003 20336 20336
s2/VIS/10063/004 10063 10063
s1/VIS/00184/008 00184 00184
s4/VIS/30517/003 30517 30517
s2/VIS/10082/001 10082 10082
s2/VIS/00005/001 00005 00005
s2/VIS/10194/002 10194 10194
s1/VIS/00053/010 00053 00053
s1/VIS/00161/001 00161 00161
s2/VIS/10240/006 10240 10240
s2/VIS/10097/006 10097 10097
s3/VIS/20474/005 20474 20474
s4/VIS/30777/002 30777 30777
s2/VIS/10139/005 10139 10139
s1/VIS/00173/003 00173 00173
s2/VIS/10069/001 10069 10069
s3/VIS/20389/006 20389 20389
s3/VIS/20478/002 20478 20478
s2/VIS/10234/006 10234 10234
s2/VIS/10204/005 10204 10204
s2/VIS/10301/005 10301 10301
s1/VIS/00202/009 00202 00202
s1/VIS/00024/004 00024 00024
s2/VIS/10270/001 10270 10270
s2/VIS/10151/005 10151 10151
s1/VIS/00132/002 00132 00132
s4/VIS/30776/001 30776 30776
s2/VIS/10232/003 10232 10232
s1/VIS/00188/010 00188 00188
s2/VIS/10153/002 10153 10153
s1/VIS/00012/003 00012 00012
s2/VIS/10271/006 10271 10271
s3/VIS/20346/004 20346 20346
s1/VIS/00182/006 00182 00182
s3/VIS/20485/005 20485 20485
s2/VIS/10191/003 10191 10191
s4/VIS/30514/003 30514 30514
s2/VIS/10255/001 10255 10255
s3/VIS/20363/003 20363 20363
s4/VIS/30780/002 30780 30780
s1/VIS/00098/006 00098 00098
s1/VIS/00051/002 00051 00051
s1/VIS/00034/005 00034 00034
s3/VIS/20326/001 20326 20326
s2/VIS/10297/001 10297 10297
s3/VIS/20334/004 20334 20334
s2/VIS/10310/003 10310 10310
s1/VIS/00072/005 00072 00072
s2/VIS/10152/004 10152 10152
s2/VIS/10165/001 10165 10165
s3/VIS/20342/001 20342 20342
s1/VIS/00135/006 00135 00135
s3/VIS/20469/004 20469 20469
s3/VIS/20339/001 20339 20339
s2/VIS/10138/005 10138 10138
s3/VIS/20479/004 20479 20479
s4/VIS/30565/003 30565 30565
s2/VIS/10248/001 10248 10248
s1/VIS/00102/009 00102 00102
s1/VIS/00152/010 00152 00152
s1/VIS/00030/003 00030 00030
s2/VIS/10008/002 10008 10008
s4/VIS/30756/002 30756 30756
s3/VIS/20324/001 20324 20324
s2/VIS/10044/006 10044 10044
s3/VIS/20333/005 20333 20333
s3/VIS/20418/003 20418 20418
s1/VIS/00189/007 00189 00189
s2/VIS/10143/006 10143 10143
s3/VIS/20391/005 20391 20391
s2/VIS/10238/002 10238 10238
s4/VIS/30515/001 30515 30515
s2/VIS/10073/002 10073 10073
s2/VIS/10089/006 10089 10089
s3/VIS/20373/005 20373 20373
s3/VIS/20323/002 20323 20323
s1/VIS/00128/011 00128 00128
s1/VIS/00179/010 00179 00179
s2/VIS/10074/004 10074 10074
s1/VIS/00077/004 00077 00077
s3/VIS/20449/002 20449 20449
s2/VIS/10141/001 10141 10141
s1/VIS/00013/009 00013 00013
s2/VIS/10038/004 10038 10038
s4/VIS/30781/001 30781 30781
s1/VIS/00015/010 00015 00015
s3/VIS/20470/005 20470 20470
s3/VIS/20329/003 20329 20329
s3/VIS/20457/005 20457 20457
s3/VIS/20441/005 20441 20441
s3/VIS/20416/003 20416 20416
s2/VIS/10258/003 10258 10258
s2/VIS/10262/001 10262 10262
s2/VIS/10106/004 10106 10106
s1/VIS/00142/008 00142 00142
s3/VIS/20361/001 20361 20361
s1/VIS/00014/004 00014 00014
s2/VIS/10005/004 10005 10005
s3/VIS/20435/005 20435 20435
s1/VIS/00064/004 00064 00064
s1/VIS/00067/009 00067 00067
s2/VIS/10144/004 10144 10144
s3/VIS/20464/006 20464 20464
s1/VIS/00086/001 00086 00086
s1/VIS/00125/004 00125 00125
s2/VIS/10103/001 10103 10103
s2/VIS/10196/003 10196 10196
s2/VIS/10280/002 10280 10280
s1/VIS/00052/002 00052 00052
s1/VIS/00133/009 00133 00133
s1/VIS/00007/008 00007 00007
s1/VIS/00056/003 00056 00056
s2/VIS/10011/003 10011 10011
s3/VIS/20332/003 20332 20332
s2/VIS/10167/005 10167 10167
s3/VIS/20486/002 20486 20486
s2/VIS/10195/001 10195 10195
s3/VIS/20417/002 20417 20417
s3/VIS/20446/004 20446 20446
s2/VIS/10306/004 10306 10306
s1/VIS/00129/007 00129 00129
s2/VIS/10236/004 10236 10236
s4/VIS/30767/003 30767 30767
s2/VIS/10085/005 10085 10085
s2/VIS/10292/002 10292 10292
s2/VIS/10050/004 10050 10050
s2/VIS/10108/006 10108 10108
s2/VIS/00123/002 00123 00123
s3/VIS/20496/005 20496 20496
s3/VIS/20471/002 20471 20471
s2/VIS/10029/002 10029 10029
s3/VIS/20406/006 20406 20406
s1/VIS/00054/007 00054 00054
s2/VIS/10259/003 10259 10259
s3/VIS/20396/003 20396 20396
s3/VIS/20461/002 20461 20461
s2/VIS/10225/001 10225 10225
s1/VIS/00021/001 00021 00021
s1/VIS/00121/002 00121 00121
s2/VIS/10146/003 10146 10146
s2/VIS/10161/001 10161 10161
s2/VIS/10299/001 10299 10299
s2/VIS/10252/001 10252 10252
s1/VIS/00037/004 00037 00037
s1/VIS/00137/003 00137 00137
s2/VIS/10017/004 10017 10017
s2/VIS/10275/001 10275 10275
s2/VIS/10290/004 10290 10290
s2/VIS/10072/004 10072 10072
s3/VIS/20401/006 20401 20401
s1/VIS/00154/011 00154 00154
s4/VIS/30674/003 30674 30674
s3/VIS/20354/006 20354 20354
s1/VIS/00106/003 00106 00106
s1/VIS/00200/002 00200 00200
s3/VIS/20495/003 20495 20495
s3/VIS/20488/003 20488 20488
s1/VIS/00103/001 00103 00103
s3/VIS/20375/002 20375 20375
s3/VIS/20325/004 20325 20325
s1/VIS/00172/004 00172 00172
s2/VIS/10130/002 10130 10130
s2/VIS/10126/004 10126 10126
s3/VIS/20341/001 20341 20341
s2/VIS/10210/002 10210 10210
s3/VIS/20442/003 20442 20442
s2/VIS/10217/006 10217 10217
s3/VIS/20426/002 20426 20426
s2/VIS/00163/003 00163 00163
s2/VIS/10127/005 10127 10127
s2/VIS/10295/006 10295 10295
This diff is collapsed.
s2/VIS/10153/003 10153 10153
s2/VIS/10117/005 10117 10117
s3/VIS/20464/004 20464 20464
s2/VIS/10113/006 10113 10113
s2/VIS/10136/008 10136 10136
s2/VIS/10188/001 10188 10188
s2/VIS/10292/004 10292 10292
s1/VIS/00130/008 00130 00130
s1/VIS/00121/002 00121 00121
s1/VIS/00100/002 00100 00100
s3/VIS/20334/004 20334 20334
s1/VIS/00126/001 00126 00126
s1/VIS/00196/008 00196 00196
s1/VIS/00150/005 00150 00150
s2/VIS/10270/003 10270 10270
s1/VIS/00147/004 00147 00147
s3/VIS/20475/003 20475 20475
s2/VIS/10231/005 10231 10231
s4/VIS/30752/003 30752 30752
s2/VIS/10076/005 10076 10076
s4/VIS/30597/001 30597 30597
s1/VIS/00043/002 00043 00043
s2/VIS/10031/004 10031 10031
s1/VIS/00165/009 00165 00165
s2/VIS/10224/006 10224 10224
s2/VIS/10142/004 10142 10142
s4/VIS/30413/002 30413 30413
s2/VIS/10085/006 10085 10085
s2/VIS/10209/003 10209 10209
s3/VIS/20326/006 20326 20326
s1/VIS/00086/009 00086 00086
s1/VIS/00162/003 00162 00162
s1/VIS/00066/010 00066 00066
s3/VIS/20397/006 20397 20397
s1/VIS/00070/001 00070 00070
s3/VIS/20353/002 20353 20353
s4/VIS/30749/001 30749 30749
s3/VIS/20480/002 20480 20480
s2/VIS/10144/002 10144 10144
s1/VIS/00071/002 00071 00071
s2/VIS/10171/002 10171 10171
s3/VIS/20376/004 20376 20376
s2/VIS/10278/001 10278 10278
s2/VIS/10124/003 10124 10124
s1/VIS/00063/010 00063 00063
s1/VIS/00019/003 00019 00019
s2/VIS/10127/002 10127 10127
s2/VIS/10045/006 10045 10045
s4/VIS/30480/002 30480 30480
s1/VIS/00027/008 00027 00027
s1/VIS/00090/005 00090 00090
s3/VIS/20355/001 20355 20355
s3/VIS/20330/003 20330 20330
s1/VIS/00018/010 00018 00018
s1/VIS/00201/008 00201 00201
s3/VIS/20411/002 20411 20411
s3/VIS/20435/006 20435 20435
s4/VIS/30773/001 30773 30773
s2/VIS/10183/003 10183 10183
s1/VIS/00081/002 00081 00081
s1/VIS/00179/008 00179 00179
s1/VIS/00189/010 00189 00189
s3/VIS/20382/005 20382 20382
s1/VIS/00154/007 00154 00154
s2/VIS/10109/002 10109 10109
s4/VIS/30781/002 30781 30781
s2/VIS/10197/008 10197 10197
s3/VIS/20481/006 20481 20481
s2/VIS/10216/001 10216 10216
s3/VIS/20366/001 20366 20366
s1/VIS/00056/002 00056 00056