Skip to content
Snippets Groups Projects
Commit 962a8513 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Merge branch '80-drop-dependency-on-latex' into 'master'

Removed TeX dependency

Closes #80

See merge request !81
parents c427c3c2 7bbcc348
No related branches found
No related tags found
1 merge request!81Removed TeX dependency
Pipeline #
#!/usr/bin/env python #!/usr/bin/env python
# vim: set fileencoding=utf-8 : # vim: set fileencoding=utf-8 :
# Manuel Guenther <manuel.guenther@idiap.ch>
# Tue Jul 2 14:52:49 CEST 2013
from __future__ import print_function
"""This script evaluates the given score files and computes EER, HTER. """This script evaluates the given score files and computes EER, HTER.
It also is able to plot CMC and ROC curves.""" It also is able to plot CMC and ROC curves.
You can set the environment variable BOB_NO_STYLE_CHANGES to any value to avoid
this script from changing the matplotlib style values. """
from __future__ import print_function
import bob.measure import bob.measure
import argparse import argparse
import numpy, math import numpy
import math
import os import os
# matplotlib stuff # matplotlib stuff
import matplotlib; matplotlib.use('pdf') #avoids TkInter threaded start import matplotlib
matplotlib.use('pdf') # avoids TkInter threaded start
from matplotlib import pyplot from matplotlib import pyplot
from matplotlib.backends.backend_pdf import PdfPages from matplotlib.backends.backend_pdf import PdfPages
# enable LaTeX interpreter if not os.environ.get('BOB_NO_STYLE_CHANGES'):
matplotlib.rc('text', usetex=True) # increase the default line width and font size
matplotlib.rc('font', family='serif') matplotlib.rc('lines', linewidth=4)
matplotlib.rc('lines', linewidth = 4) matplotlib.rc('font', size=18)
# increase the default font size
matplotlib.rc('font', size=18)
import bob.core import bob.core
logger = bob.core.log.setup("bob.bio.base") logger = bob.core.log.setup("bob.bio.base")
...@@ -110,11 +110,12 @@ def _plot_roc(frrs, colors, labels, title, fontsize=18, position=None): ...@@ -110,11 +110,12 @@ def _plot_roc(frrs, colors, labels, title, fontsize=18, position=None):
pyplot.plot([0.1,0.1],[0,100], "--", color=(0.3,0.3,0.3)) pyplot.plot([0.1,0.1],[0,100], "--", color=(0.3,0.3,0.3))
pyplot.axis([frrs[0][0][0]*100,100,0,100]) pyplot.axis([frrs[0][0][0]*100,100,0,100])
pyplot.xticks((0.01, 0.1, 1, 10, 100), ('0.01', '0.1', '1', '10', '100')) pyplot.xticks((0.01, 0.1, 1, 10, 100), ('0.01', '0.1', '1', '10', '100'))
pyplot.xlabel('FAR (\%)') pyplot.xlabel('FAR (%)')
pyplot.ylabel('CAR (\%)') pyplot.ylabel('CAR (%)')
pyplot.grid(True, color=(0.6,0.6,0.6)) pyplot.grid(True, color=(0.6,0.6,0.6))
pyplot.legend(loc=position, prop = {'size':fontsize}) pyplot.legend(loc=position, prop = {'size':fontsize})
pyplot.title(title) pyplot.title(title)
figure.set_tight_layout(True)
return figure return figure
...@@ -136,10 +137,11 @@ def _plot_det(dets, colors, labels, title, fontsize=18, position=None): ...@@ -136,10 +137,11 @@ def _plot_det(dets, colors, labels, title, fontsize=18, position=None):
pyplot.yticks(ticks, labels) pyplot.yticks(ticks, labels)
pyplot.axis((ticks[0], ticks[-1], ticks[0], ticks[-1])) pyplot.axis((ticks[0], ticks[-1], ticks[0], ticks[-1]))
pyplot.xlabel('FAR (\%)') pyplot.xlabel('FAR (%)')
pyplot.ylabel('FRR (\%)') pyplot.ylabel('FRR (%)')
pyplot.legend(loc=position, prop = {'size':fontsize}) pyplot.legend(loc=position, prop = {'size':fontsize})
pyplot.title(title) pyplot.title(title)
figure.set_tight_layout(True)
return figure return figure
...@@ -157,11 +159,12 @@ def _plot_cmc(cmcs, colors, labels, title, fontsize=18, position=None): ...@@ -157,11 +159,12 @@ def _plot_cmc(cmcs, colors, labels, title, fontsize=18, position=None):
# change axes accordingly # change axes accordingly
ticks = [int(t) for t in pyplot.xticks()[0]] ticks = [int(t) for t in pyplot.xticks()[0]]
pyplot.xlabel('Rank') pyplot.xlabel('Rank')
pyplot.ylabel('Probability (\%)') pyplot.ylabel('Probability (%)')
pyplot.xticks(ticks, [str(t) for t in ticks]) pyplot.xticks(ticks, [str(t) for t in ticks])
pyplot.axis([0, max_x, 0, 100]) pyplot.axis([0, max_x, 0, 100])
pyplot.legend(loc=position, prop = {'size':fontsize}) pyplot.legend(loc=position, prop = {'size':fontsize})
pyplot.title(title) pyplot.title(title)
figure.set_tight_layout(True)
return figure return figure
...@@ -178,11 +181,12 @@ def _plot_epc(scores_dev, scores_eval, colors, labels, title, fontsize=18, posit ...@@ -178,11 +181,12 @@ def _plot_epc(scores_dev, scores_eval, colors, labels, title, fontsize=18, posit
# change axes accordingly # change axes accordingly
pyplot.xlabel('alpha') pyplot.xlabel('alpha')
pyplot.ylabel('HTER (\\%)') pyplot.ylabel('HTER (%)')
pyplot.title(title) pyplot.title(title)
pyplot.grid(True) pyplot.grid(True)
pyplot.legend(loc=position, prop = {'size':fontsize}) pyplot.legend(loc=position, prop = {'size':fontsize})
pyplot.title(title) pyplot.title(title)
figure.set_tight_layout(True)
return figure return figure
......
...@@ -82,16 +82,13 @@ updated, and the corrected paths for those you have. ...@@ -82,16 +82,13 @@ updated, and the corrected paths for those you have.
If you have installed only ``bob.bio.base``, there is no database listed -- If you have installed only ``bob.bio.base``, there is no database listed --
as all databases are included in other packages, such as as all databases are included in other packages, such as
:ref:`bob.bio.face <bob.bio.face>` or :ref:`bob.bio.spear <bob.bio.spear>`. :ref:`bob.bio.face <bob.bio.face>` or :ref:`bob.bio.spear <bob.bio.spear>`.
Also, please don't forget that you need to install the corresponding
``bob.db.<name>`` package as well.
Test your Installation Test your Installation
---------------------- ----------------------
.. note::
For some of the tests to pass, you need to install
`LaTeX <https://en.wikipedia.org/wiki/LaTeX>`_ on your machine.
You can install the ``nose`` package to test your installation and use that to You can install the ``nose`` package to test your installation and use that to
verify your installation: verify your installation:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment