Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
962a8513
There was a problem fetching the pipeline summary.
Commit
962a8513
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Plain Diff
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
!81
Removed TeX dependency
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/base/script/evaluate.py
+23
-19
23 additions, 19 deletions
bob/bio/base/script/evaluate.py
doc/installation.rst
+2
-5
2 additions, 5 deletions
doc/installation.rst
with
25 additions
and
24 deletions
bob/bio/base/script/evaluate.py
+
23
−
19
View file @
962a8513
#!/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
...
...
This diff is collapsed.
Click to expand it.
doc/installation.rst
+
2
−
5
View file @
962a8513
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment