Commit 9a6f3a67 authored by André Anjos's avatar André Anjos 💬
Browse files

Standardise + Refactor

parent 6942c952
Pipeline #3240 passed with stages
in 93 minutes and 34 seconds
# This build file is defined in two parts: 1) a generic set of instructions you
# probably **don't** need to change and 2) a part you may have to tune to your
# project. It heavily uses template features from YAML to help you in only
# changing a minimal part of it and avoid code duplication to a maximum while
# still providing a nice pipeline display on your package.
# 1) Generic instructions (only change if you know what you're doing)
# -------------------------------------------------------------------
# Definition of our build pipeline
stages:
- build
- test
- docs
- wheels
# Global variables
variables:
CONDA_PREFIX: env
# Template for the build stage
# Needs to run on all supported architectures, platforms and python versions
.build_template: &build_job
stage: build
before_script:
- git clean -ffdx
- curl --silent https://gitlab.idiap.ch/bob/bob/snippets/7/raw | tr -d '\r' > bootstrap-conda.sh
- chmod 755 ./bootstrap-conda.sh
- ./bootstrap-conda.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX}
variables: &build_variables
BOB_DOCUMENTATION_SERVER: "http://www.idiap.ch/software/bob/docs/latest/bob/%s/master/"
script:
- ./bin/buildout
- if [ -x ./bin/bob_dbmanage.py ]; then ./bin/bob_dbmanage.py all download --force; fi
- ./bin/sphinx-build doc sphinx
- ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG}
after_script:
- rm -rf ${CONDA_PREFIX}
artifacts:
expire_in: 1 day
paths:
- bootstrap-conda.sh
- dist/
- sphinx/
# Template for building on a Linux machine
.build_linux_template: &linux_build_job
<<: *build_job
variables: &linux_build_variables
<<: *build_variables
CONDA_FOLDER: "/local/conda"
CFLAGS: "-D_GLIBCXX_USE_CXX11_ABI=0 -coverage"
CXXFLAGS: "-D_GLIBCXX_USE_CXX11_ABI=0 -coverage"
# Template for building on a Mac OSX machine
.build_mac_template: &macosx_build_job
<<: *build_job
variables: &macosx_build_variables
<<: *build_variables
CONDA_FOLDER: "/opt/conda"
MACOSX_DEPLOYMENT_TARGET: "10.9"
CFLAGS: "-pthread -coverage"
CXXFLAGS: "-pthread -coverage"
LDFLAGS: "-lpthread"
# Template for the test stage - re-install from uploaded wheels
# Needs to run on all supported architectures, platforms and python versions
.test_template: &test_job
stage: test
before_script:
- ./bootstrap-conda.sh ${CONDA_FOLDER} ${PYTHON_VER} ${CONDA_PREFIX}
- source ${CONDA_FOLDER}/bin/activate ${CONDA_PREFIX}
- pip install --use-wheel --no-index --pre dist/*.whl
script:
- cd ${CONDA_PREFIX}
- python -c "from ${CI_PROJECT_NAME} import get_config; print(get_config())"
- coverage run --source=${CI_PROJECT_NAME} ./bin/nosetests -sv ${CI_PROJECT_NAME}
- coverage report
- sphinx-build -b doctest ../doc ../sphinx
after_script:
- rm -rf ${CONDA_PREFIX}
# Template for the wheel uploading stage
# Needs to run against one combination of python 2.x and 3.x if it is a python
# only package, otherwise, needs to run in both pythons to all supported
# architectures (Linux and Mac OSX 64-bit)
.wheels_template: &wheels_job
stage: wheels
only:
- master
- tags
before_script:
- curl --silent https://gitlab.idiap.ch/bob/bob/snippets/8/raw | tr -d '\r' > upload-wheel.sh
- chmod 755 upload-wheel.sh
script:
- ./upload-wheel.sh
# Template for (latest) documentation upload stage
# Only one real job needs to do this
.docs_template: &docs_job
stage: docs
only:
- master
before_script:
- curl --silent https://gitlab.idiap.ch/bob/bob/snippets/9/raw | tr -d '\r' > upload-sphinx.sh
- chmod 755 upload-sphinx.sh
script:
- ./upload-sphinx.sh
# 2) Package specific instructions (you may tune this if needed)
# --------------------------------------------------------------
# Linux + Python 2.7: Builds, tests, uploads wheel
build_linux_27:
<<: *linux_build_job
variables: &linux_27_build_variables
<<: *linux_build_variables
PYTHON_VER: "2.7"
WHEEL_TAG: "py27"
tags:
- conda-linux
test_linux_27:
<<: *test_job
variables: *linux_27_build_variables
dependencies:
- build_linux_27
tags:
- conda-linux
wheels_linux_27:
<<: *wheels_job
dependencies:
- build_linux_27
tags:
- conda-linux
# Linux + Python 3.4: Builds and tests
build_linux_34:
<<: *linux_build_job
variables: &linux_34_build_variables
<<: *linux_build_variables
PYTHON_VER: "3.4"
WHEEL_TAG: "py3"
tags:
- conda-linux
test_linux_34:
<<: *test_job
variables: *linux_34_build_variables
dependencies:
- build_linux_34
tags:
- conda-linux
# Linux + Python 3.5: Builds, tests, uploads wheel
build_linux_35:
<<: *linux_build_job
variables: &linux_35_build_variables
<<: *linux_build_variables
PYTHON_VER: "3.5"
WHEEL_TAG: "py3"
tags:
- conda-linux
test_linux_35:
<<: *test_job
variables: *linux_35_build_variables
dependencies:
- build_linux_35
tags:
- conda-linux
wheels_linux_35:
<<: *wheels_job
dependencies:
- build_linux_35
tags:
- conda-linux
docs_linux_35:
<<: *docs_job
dependencies:
- build_linux_35
tags:
- conda-linux
# Mac OSX + Python 2.7: Builds and tests
build_macosx_27:
<<: *macosx_build_job
variables: &macosx_27_build_variables
<<: *macosx_build_variables
PYTHON_VER: "2.7"
WHEEL_TAG: "py27"
tags:
- conda-macosx
test_macosx_27:
<<: *test_job
variables: *macosx_27_build_variables
dependencies:
- build_macosx_27
tags:
- conda-macosx
# Mac OSX + Python 3.4: Builds and tests
build_macosx_34:
<<: *macosx_build_job
variables: &macosx_34_build_variables
<<: *macosx_build_variables
PYTHON_VER: "3.4"
WHEEL_TAG: "py3"
tags:
- conda-macosx
test_macosx_34:
<<: *test_job
variables: *macosx_34_build_variables
dependencies:
- build_macosx_34
tags:
- conda-macosx
# Mac OSX + Python 3.5: Builds and tests
build_macosx_35:
<<: *macosx_build_job
variables: &macosx_35_build_variables
<<: *macosx_build_variables
PYTHON_VER: "3.5"
WHEEL_TAG: "py3"
tags:
- conda-macosx
test_macosx_35:
<<: *test_job
variables: *macosx_35_build_variables
dependencies:
- build_macosx_35
tags:
- conda-macosx
\ No newline at end of file
language: python
env:
global:
- secure: MPgfLy1TeHcTfPcRqnKAqzvDAeHoAGEf7+O6KqI0R71vtUc5tz/RdCmG/pbPzNRSo5m8nPWs4/R04enbC/mjb8ibxqZixTQ8ZLOEZDrLFwpzn7aVIS7Dr0dLrk1/gFQKUy1jpQF554VZK02dYz03E6UkjRLuyIn0aA1N0jJF2bM=
- secure: R//IYVHP3G4JQah/AhEhT8HCmESN5FsC1JGjFQK05/q9QFm6Ztgqk86EZ2bDA1DW0eTZ47dmyQ3wJwoWI6DcgQeWAIred/iK2ZtKAMefmvwRjnxEDcE+D9F2ZCOB0HNW5o7LtuwsbXWNE2Z880pOBKVkQJyFKLfnwkywOv6/irI=
- BOB_UPLOAD_WHEEL=1
matrix:
include:
- python: 2.7
env:
- BOB_DOCUMENTATION_SERVER=https://www.idiap.ch/software/bob/docs/latest/bioidiap/%s/master
- python: 3.3
- python: 3.4
- python: 3.5
before_install:
- sudo add-apt-repository -y ppa:biometrics/bob
- sudo apt-get update -qq
- sudo apt-get install -qq --force-yes libboost-all-dev libblitz1-dev libhdf5-serial-dev libatlas-dev libatlas-base-dev liblapack-dev texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
- pip install --upgrade pip
- pip install --find-links https://www.idiap.ch/software/bob/wheels/travis/ --use-wheel sphinx nose coverage cpp-coveralls pillow
- pip install --find-links https://www.idiap.ch/software/bob/wheels/travis/ --use-wheel --pre -r requirements.txt coveralls
install:
- python bootstrap-buildout.py
- ./bin/buildout
script:
- ./bin/python -c 'from bob.db.utfvp import get_config; print(get_config())'
- ./bin/bob_dbmanage.py utfvp download
- ./bin/coverage run --source=bob.db.utfvp ./bin/nosetests -sv
- ./bin/sphinx-build -b doctest doc sphinx
- ./bin/sphinx-build -b html doc sphinx
after_success:
- coveralls
- wget https://raw.githubusercontent.com/bioidiap/bob.extension/master/scripts/upload-{sphinx,wheel}.sh
- chmod a+x upload-sphinx.sh upload-wheel.sh
- ./upload-sphinx.sh
- ./upload-wheel.sh
Copyright (c) 2016, Andre Anjos - Idiap Research Institute
All rights reserved.
Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
Written by Andre Anjos <andre.anjos@idiap.ch>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer. Redistributions in binary
form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with
the distribution. Neither the name of the Idiap Research Institute nor the
names of its contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
......@@ -21,4 +24,4 @@ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
include README.rst bootstrap-buildout.py buildout.cfg COPYING requirements.txt version.txt
include README.rst bootstrap-buildout.py buildout.cfg develop.cfg COPYING requirements.txt version.txt
recursive-include doc *.py *.rst
recursive-include bob *.sql3
.. vim: set fileencoding=utf-8 :
.. Wed 03 Aug 2016 09:05:32 CEST
.. Thu 18 Aug 17:23:48 CEST 2016
.. image:: http://img.shields.io/badge/docs-stable-yellow.png
:target: http://pythonhosted.org/bob.db.utfvp/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png
:target: https://www.idiap.ch/software/bob/docs/latest/bioidiap/bob.db.utfvp/master/index.html
.. image:: https://travis-ci.org/bioidiap/bob.db.utfvp.svg?branch=master
:target: https://travis-ci.org/bioidiap/bob.db.utfvp
.. image:: https://coveralls.io/repos/bioidiap/bob.db.utfvp/badge.svg?branch=master
:target: https://coveralls.io/r/bioidiap/bob.db.utfvp
.. image:: https://img.shields.io/badge/github-master-0000c0.png
:target: https://github.com/bioidiap/bob.db.utfvp/tree/master
:target: https://www.idiap.ch/software/bob/docs/latest/bob/bob.db.utfvp/master/index.html
.. image:: https://gitlab.idiap.ch/bob/bob.db.utfvp/badges/master/build.svg
:target: https://gitlab.idiap.ch/bob/bob.db.utfvp/commits/master
.. image:: https://img.shields.io/badge/gitlab-project-0000c0.svg
:target: https://gitlab.idiap.ch/bob/bob.db.utfvp
.. image:: http://img.shields.io/pypi/v/bob.db.utfvp.png
:target: https://pypi.python.org/pypi/bob.db.utfvp
.. image:: http://img.shields.io/pypi/dm/bob.db.utfvp.png
:target: https://pypi.python.org/pypi/bob.db.utfvp
.. image:: https://img.shields.io/badge/raw-data--files-a000a0.png
:target: http://www.sas.ewi.utwente.nl
=============================================
UTFVP Fingervein Database Interface for Bob
=============================================
This package contains an interface for the evaluation protocols of the `UTFVP
This package is part of the signal-processing and machine learning toolbox
Bob_. It contains an interface for the evaluation protocols of the `UTFVP
Fingervein Database`_. Notice this package does not contain the raw data files
from this dataset, which need to be obtained through the link above.
About
-----
Installation
------------
This package is currently developed at the `Biometrics group`_ at the `Idiap
Research Institute`_.
Follow our `installation`_ instructions. Then, using the Python interpreter
provided by the distribution, bootstrap and buildout this package::
$ python bootstrap-buildout.py
$ ./bin/buildout
Installation
------------
This package only contains database access functions so it is easy to
programatically reproduce evaluation results obtained in papers. You normally
don't install this package, unless you're modifying it. Instead, install one of
our top-level frameworks for vein image processing, such as ``bob.bio.vein``.
Contact
-------
For questions or reporting issues to this software package, contact our
development `mailing list`_.
.. Write your references here:
.. Place your references here:
.. _bob: https://www.idiap.ch/software/bob
.. _installation: https://gitlab.idiap.ch/bob/bob/wikis/Installation
.. _mailing list: https://groups.google.com/forum/?fromgroups#!forum/bob-devel
.. _utfvp fingervein database: http://www.sas.ewi.utwente.nl
.. _biometrics group: http://www.idiap.ch/scientific-research/research-groups/biometric-person-recognition
.. _idiap research institute: http://www.idiap.ch
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
# Laurent El Shafey <laurent.el-shafey@idiap.ch>
#
# Copyright (C) 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/>.
"""The UTFVP Database for finger verification
"""
......
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
# Laurent El Shafey <Laurent.El-Shafey@idiap.ch>
#
# Copyright (C) 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/>.
"""This script creates the UTFVP database in a single pass.
"""
......@@ -60,7 +44,7 @@ def add_files(session, imagedir, verbose):
session.refresh(cfile)
return cfile
if verbose: print("Adding files...")
subdir_list = list(filter(nodot, os.listdir(imagedir)))
client_dict = {}
......@@ -76,7 +60,7 @@ def add_files(session, imagedir, verbose):
def add_protocols(session, file_list, verbose):
"""Adds protocols"""
# 2. ADDITIONS TO THE SQL DATABASE
protocol_list = ['1vsall', 'nom','nomLeftRing','nomLeftMiddle','nomLeftIndex','nomRightIndex','nomRightMiddle','nomRightRing']
for proto in protocol_list:
......@@ -86,14 +70,14 @@ def add_protocols(session, file_list, verbose):
session.add(p)
session.flush()
session.refresh(p)
if proto == '1vsall':
# Helper function
def isWorldFile(f_file):
return f_file.client.subclient_id <= 35 and f_file.finger_id == ((f_file.client.subclient_id-1) % 6) + 1
model_dict = {}
for f_file in file_list:
for f_file in file_list:
if not isWorldFile(f_file):
model_id = "%s_%d" % (f_file.client_id, f_file.session_id)
if verbose>1: print(" Adding Model '%s'..." %(model_id, ))
......@@ -113,28 +97,28 @@ def add_protocols(session, file_list, verbose):
model_dict[model_id].enrollment_files.append(f_file)
if verbose>1: print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..." % (f_file.path, model_id, p.name, 'dev', 'enroll'))
session.flush()
else:
p.train_files.append(f_file)
if verbose>1: print(" Adding file ('%s') to protocol purpose ('%s', '%s','%s')..." % (f_file.path, p.name, 'world', 'train'))
if proto == 'nom':
# Helper functions
def isDevEnrollFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id <= 2)
def isDevProbeFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id > 2)
def isEvalEnrollFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id <= 2)
def isEvalProbeFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id > 2)
model_dict = {}
for f_file in file_list:
model_id = f_file.client_id
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if verbose>1: print(" Adding Model '%s'..." %(model_id, ))
if not model_id in model_dict:
sgroup = 'dev' if isDevEnrollFile(f_file) else 'eval'
......@@ -163,30 +147,30 @@ def add_protocols(session, file_list, verbose):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
model_dict[model_id].enrollment_files.append(f_file)
if verbose>1: print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..." % (f_file.path, model_id, p.name, 'dev' if isDevEnrollFile(f_file) else 'eval', 'enroll'))
elif f_file.client.subclient_id <= 10:
p.train_files.append(f_file)
if verbose>1: print(" Adding file ('%s') to protocol purpose ('%s', '%s','%s')..." % (f_file.path, p.name, 'world', 'train'))
if verbose>1: print(" Adding file ('%s') to protocol purpose ('%s', '%s','%s')..." % (f_file.path, p.name, 'world', 'train'))
if proto == 'nomLeftRing':
# Helper functions
def isDevEnrollFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id <= 2 and f_file.finger_id == 1)
def isDevProbeFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id > 2 and f_file.finger_id == 1)
def isEvalEnrollFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id <= 2 and f_file.finger_id == 1)
def isEvalProbeFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id > 2 and f_file.finger_id == 1)
model_dict = {}
for f_file in file_list:
model_id = f_file.client_id
#import ipdb; ipdb.set_trace()
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
#import ipdb; ipdb.set_trace()
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if verbose>1: print(" Adding Model '%s'..." %(model_id, ))
if not model_id in model_dict:
sgroup = 'dev' if isDevEnrollFile(f_file) else 'eval'
......@@ -215,28 +199,28 @@ def add_protocols(session, file_list, verbose):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
model_dict[model_id].enrollment_files.append(f_file)
if verbose>1: print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..." % (f_file.path, model_id, p.name, 'dev' if isDevEnrollFile(f_file) else 'eval', 'enroll'))
elif f_file.client.subclient_id <= 10 and f_file.finger_id == 1:
p.train_files.append(f_file)
if verbose>1: print(" Adding file ('%s') to protocol purpose ('%s', '%s','%s')..." % (f_file.path, p.name, 'world', 'train'))
if proto == 'nomLeftMiddle':
# Helper functions
def isDevEnrollFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id <= 2 and f_file.finger_id == 2)
def isDevProbeFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id > 2 and f_file.finger_id == 2)
def isEvalEnrollFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id <= 2 and f_file.finger_id == 2)
def isEvalProbeFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id > 2 and f_file.finger_id == 2)
model_dict = {}
for f_file in file_list:
model_id = f_file.client_id
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if verbose>1: print(" Adding Model '%s'..." %(model_id, ))
if not model_id in model_dict:
sgroup = 'dev' if isDevEnrollFile(f_file) else 'eval'
......@@ -265,28 +249,28 @@ def add_protocols(session, file_list, verbose):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
model_dict[model_id].enrollment_files.append(f_file)
if verbose>1: print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..." % (f_file.path, model_id, p.name, 'dev' if isDevEnrollFile(f_file) else 'eval', 'enroll'))
elif f_file.client.subclient_id <= 10 and f_file.finger_id == 2:
p.train_files.append(f_file)
if verbose>1: print(" Adding file ('%s') to protocol purpose ('%s', '%s','%s')..." % (f_file.path, p.name, 'world', 'train'))
if proto == 'nomLeftIndex':
# Helper functions
def isDevEnrollFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id <= 2 and f_file.finger_id == 3)
def isDevProbeFile(f_file):
return (f_file.client.subclient_id >= 11 and f_file.client.subclient_id <= 28 and f_file.session_id > 2 and f_file.finger_id == 3)
def isEvalEnrollFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id <= 2 and f_file.finger_id == 3)
def isEvalProbeFile(f_file):
return (f_file.client.subclient_id >= 29 and f_file.session_id > 2 and f_file.finger_id == 3)
model_dict = {}
for f_file in file_list:
model_id = f_file.client_id
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
if verbose>1: print(" Adding Model '%s'..." %(model_id, ))
if not model_id in model_dict:
sgroup = 'dev' if isDevEnrollFile(f_file) else 'eval'
......@@ -315,28 +299,28 @@ def add_protocols(session, file_list, verbose):
if isDevEnrollFile(f_file) or isEvalEnrollFile(f_file):
model_dict[model_id].enrollment_files.append(f_file)
if verbose>1: print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..." % (f_file.path, model_id, p.name, 'dev' if isDevEnrollFile(f_file) else 'eval', 'enroll'))