diff --git a/bob/bio/base/algorithm/Algorithm.py b/bob/bio/base/algorithm/Algorithm.py index 6023d3df0cf00e6a16e38cbd79930120094ac6b5..8935d4d6ac63c5fcde6ced57f0e32d8c4791b55d 100644 --- a/bob/bio/base/algorithm/Algorithm.py +++ b/bob/bio/base/algorithm/Algorithm.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Tue Oct 2 12:12:39 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. import numpy import os diff --git a/bob/bio/base/extractor/Extractor.py b/bob/bio/base/extractor/Extractor.py index 6dd59a5536d7ecd604235bb7202f4bcd096cf4ff..4a0dbcd8f0c3aded41d11eecbbfafd44a8da4a67 100644 --- a/bob/bio/base/extractor/Extractor.py +++ b/bob/bio/base/extractor/Extractor.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Tue Oct 2 12:12:39 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. import os diff --git a/bob/bio/base/extractor/Linearize.py b/bob/bio/base/extractor/Linearize.py index d686bd709421276b1eae6a4839b14de261d490b8..be71e0fe1ad621ffbb1c70029e297d2baff22325 100644 --- a/bob/bio/base/extractor/Linearize.py +++ b/bob/bio/base/extractor/Linearize.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Fri Oct 26 17:05:40 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. from .Extractor import Extractor import numpy diff --git a/bob/bio/base/grid.py b/bob/bio/base/grid.py index a710bada92feca1c2ed099ba73a4a1bd56244252..def7125b0920f830f3de2dc743499d41da71efc9 100644 --- a/bob/bio/base/grid.py +++ b/bob/bio/base/grid.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Tue Oct 2 12:12:39 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. PREDEFINED_QUEUES = { diff --git a/bob/bio/base/preprocessor/Filename.py b/bob/bio/base/preprocessor/Filename.py index a1ab0f6448d125865bfcf5253ed2ef6a790472cf..fc4c5912556c6b9a73c4f9c5f4650563e7e103d5 100644 --- a/bob/bio/base/preprocessor/Filename.py +++ b/bob/bio/base/preprocessor/Filename.py @@ -1,18 +1,5 @@ # @date Wed May 11 12:39:37 MDT 2016 # @author Manuel Gunther <siebenkopf@googlemail.com> -# -# Copyright (c) 2016, Regents of the University of Colorado on behalf of the University of Colorado Colorado Springs. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -# -# 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 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 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. import bob.io.base diff --git a/bob/bio/base/preprocessor/Preprocessor.py b/bob/bio/base/preprocessor/Preprocessor.py index 4203b518afd145fc47dacbff4ae8b57135deca69..268a7b7a16f2fb67864a98f526eca7e64f78f4ca 100644 --- a/bob/bio/base/preprocessor/Preprocessor.py +++ b/bob/bio/base/preprocessor/Preprocessor.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Tue Oct 2 12:12:39 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. import bob.io.base diff --git a/bob/bio/base/script/collect_results.py b/bob/bio/base/script/collect_results.py index b9438c0e2863ebfeade6d857cf0ec59de8fcc429..1aacf2578c99cb5e9119da24de9ac4acadd8d8ca 100644 --- a/bob/bio/base/script/collect_results.py +++ b/bob/bio/base/script/collect_results.py @@ -2,20 +2,7 @@ # vim: set fileencoding=utf-8 : # Manuel Guenther <manuel.guenther@idiap.ch> # Tue Jul 2 14:52:49 CEST 2013 -# -# Copyright (C) 2011-2013 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/>. + from __future__ import print_function """ diff --git a/bob/bio/base/script/evaluate.py b/bob/bio/base/script/evaluate.py index 80f47778f3bf7d3e3668ef5284f050362860a0ec..a48eebf0d915aa43d2b01a39311ea0e7a1f29fbd 100644 --- a/bob/bio/base/script/evaluate.py +++ b/bob/bio/base/script/evaluate.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # Manuel Guenther <manuel.guenther@idiap.ch> # Tue Jul 2 14:52:49 CEST 2013 -# -# Copyright (C) 2011-2013 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 ipyplotied 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/>. from __future__ import print_function @@ -70,7 +56,7 @@ def command_line_arguments(command_line_parameters): parser.add_argument('-R', '--roc', help = "If given, ROC curves will be plotted into the given pdf file.") parser.add_argument('-D', '--det', help = "If given, DET curves will be plotted into the given pdf file.") parser.add_argument('-C', '--cmc', help = "If given, CMC curves will be plotted into the given pdf file.") - parser.add_argument('-E', '--epc', help = "If given, EPC curves will be plotted into the given pdf file. For this plot --eval-files is mandatory.") + parser.add_argument('-E', '--epc', help = "If given, EPC curves will be plotted into the given pdf file. For this plot --eval-files is mandatory.") parser.add_argument('--parser', default = '4column', choices = ('4column', '5column'), help="The style of the resulting score files. The default fits to the usual output of score files.") # add verbose option @@ -178,9 +164,9 @@ def _plot_cmc(cmcs, colors, labels, title, fontsize=18, position=None): pyplot.title(title) return figure - - - + + + def _plot_epc(scores_dev, scores_eval, colors, labels, title, fontsize=18, position=None): if position is None: position = 4 # open new page for current plot @@ -198,7 +184,7 @@ def _plot_epc(scores_dev, scores_eval, colors, labels, title, fontsize=18, posit pyplot.legend(loc=position, prop = {'size':fontsize}) pyplot.title(title) - return figure + return figure @@ -234,15 +220,15 @@ def main(command_line_parameters=None): # apply threshold to development set far, frr = bob.measure.farfrr(scores_dev[i][0], scores_dev[i][1], threshold) if args.criterion == 'FAR': - print("The FRR at FAR=%2.3f%% of the development set of '%s' is %2.3f%% (CAR: %2.3f%%)" % (args.far_value, args.legends[i], frr * 100., 100.*(1-frr))) - else: + print("The FRR at FAR=%2.3f%% of the development set of '%s' is %2.3f%% (CAR: %2.3f%%)" % (args.far_value, args.legends[i], frr * 100., 100.*(1-frr))) + else: print("The %s of the development set of '%s' is %2.3f%%" % (args.criterion, args.legends[i], (far + frr) * 50.)) # / 2 * 100% if args.eval_files: # apply threshold to evaluation set far, frr = bob.measure.farfrr(scores_eval[i][0], scores_eval[i][1], threshold) if args.criterion == 'FAR': print("The FRR of the evaluation set of '%s' is %2.3f%% (CAR: %2.3f%%)" % (args.legends[i], frr * 100., 100.*(1-frr))) # / 2 * 100% - else: + else: print("The HTER of the evaluation set of '%s' is %2.3f%%" % (args.legends[i], (far + frr) * 50.)) # / 2 * 100% @@ -318,10 +304,10 @@ def main(command_line_parameters=None): if args.epc: logger.info("Plotting EPC curves to file '%s'", args.epc) - + if not args.eval_files: raise ValueError("To plot the EPC curve the evaluation scores are necessary. Please, set it with the --eval-files option.") - + try: # create a multi-page PDF for the ROC curve pdf = PdfPages(args.epc) diff --git a/bob/bio/base/script/fuse_scores.py b/bob/bio/base/script/fuse_scores.py index f8b94d0a748d02a22b606f4d915e8089e57c91d9..693e6ec651842210ed42fb2df0213319386386d2 100755 --- a/bob/bio/base/script/fuse_scores.py +++ b/bob/bio/base/script/fuse_scores.py @@ -4,20 +4,6 @@ # Elie El Khoury <elie.khoury@idiap.ch> # Manuel Guenther <siebenkopf@googlemail.com> # Mon 13 Jul 11:55:34 CEST 2015 -# -# Copyright (C) 2011-2013 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 fuses scores from various systems, from a score file in four or five column format. diff --git a/bob/bio/base/script/grid_search.py b/bob/bio/base/script/grid_search.py index 73287b174303e8cf55e584b8af0b2f838f7b3e15..ea2dc5e8594291b8008a9bc06322b78ff4b84a75 100755 --- a/bob/bio/base/script/grid_search.py +++ b/bob/bio/base/script/grid_search.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : # Manuel Guenther <Manuel.Guenther@idiap.ch> + from __future__ import print_function from . import verify diff --git a/bob/bio/base/test/test_algorithms.py b/bob/bio/base/test/test_algorithms.py index f479f737d799bd56c2b9131003abd24d2acfa671..1afbc7f9c4116127d1f042b5f937646bef8f70f6 100644 --- a/bob/bio/base/test/test_algorithms.py +++ b/bob/bio/base/test/test_algorithms.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Thu May 24 10:41:42 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. import os import shutil @@ -220,7 +206,7 @@ def test_lda(): def test_distance(): import scipy.spatial - + # assure that the configurations are loadable distance = bob.bio.base.load_resource("distance-cosine", "algorithm", preferred_package = 'bob.bio.base') assert isinstance(distance, bob.bio.base.algorithm.Distance) @@ -231,17 +217,17 @@ def test_distance(): assert distance.use_projected_features_for_enrollment == False assert distance.split_training_features_by_client == False assert distance.requires_enroller_training == False - + distance = bob.bio.base.algorithm.Distance( distance_function = scipy.spatial.distance.cosine, is_distance_function = True - ) + ) # compare model with probe enroll = utils.random_training_set(5, 5, 0., 255., seed=21); model = numpy.mean(distance.enroll(enroll),axis=0) probe = distance.read_probe(pkg_resources.resource_filename('bob.bio.base.test', 'data/lda_projected.hdf5')) - + reference_score = -0.1873371 assert abs(distance.score(model, probe) - reference_score) < 1e-5, "The scores differ: %3.8f, %3.8f" % (distance.score(model, probe), reference_score) diff --git a/bob/bio/base/test/utils.py b/bob/bio/base/test/utils.py index bd1a9ff13957d0d4c08e49733e63cfd854686feb..7d757b036e28af9bf66ecab2d09f38e2ddc0c29d 100644 --- a/bob/bio/base/test/utils.py +++ b/bob/bio/base/test/utils.py @@ -2,20 +2,6 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Thu Jul 19 17:09:55 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. import numpy import os diff --git a/bob/bio/base/utils/resources.py b/bob/bio/base/utils/resources.py index 2789efe1268b1320822893b462d8731e36b8922b..8be8e0304d5dc243ef17b8919dc73557c19a3a4b 100644 --- a/bob/bio/base/utils/resources.py +++ b/bob/bio/base/utils/resources.py @@ -2,20 +2,7 @@ # vim: set fileencoding=utf-8 : # @author: Manuel Guenther <Manuel.Guenther@idiap.ch> # @date: Thu Oct 25 10:05:55 CEST 2012 -# -# Copyright (C) 2011-2012 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/>. + from __future__ import print_function import imp