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
347bf423
There was a problem fetching the pipeline summary.
Commit
347bf423
authored
8 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Plain Diff
Merge branch '10-create-a-test-to-prevent-some-errors-for-scoring-tools' into 'master'
Resolve "Create a test to prevent some errors for scoring tools" Closes
#10
See merge request
!32
parents
24bda38f
9351e02a
No related branches found
No related tags found
1 merge request
!32
Resolve "Create a test to prevent some errors for scoring tools"
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/bio/base/test/dummy/algorithm_noprojection.py
+46
-0
46 additions, 0 deletions
bob/bio/base/test/dummy/algorithm_noprojection.py
bob/bio/base/test/test_scripts.py
+19
-0
19 additions, 0 deletions
bob/bio/base/test/test_scripts.py
develop.cfg
+20
-20
20 additions, 20 deletions
develop.cfg
with
85 additions
and
20 deletions
bob/bio/base/test/dummy/algorithm_noprojection.py
0 → 100644
+
46
−
0
View file @
347bf423
import
scipy.spatial
import
bob.io.base
from
bob.bio.base.algorithm
import
Algorithm
_data
=
[
5.
,
6.
,
7.
,
8.
,
9.
]
class
DummyAlgorithm
(
Algorithm
):
"""
This class is used to test all the possible functions of the tool chain, but it does basically nothing.
"""
def
__init__
(
self
,
**
kwargs
):
"""
Generates a test value that is read and written
"""
# call base class constructor registering that this tool performs everything.
Algorithm
.
__init__
(
self
,
performs_projection
=
False
,
requires_enroller_training
=
True
)
def
_test
(
self
,
file_name
):
"""
Simply tests that the read data is consistent
"""
data
=
bob
.
io
.
base
.
load
(
file_name
)
assert
(
_data
==
data
).
all
()
def
train_enroller
(
self
,
train_files
,
enroller_file
):
"""
Does not train the projector, but writes some file
"""
# save something
bob
.
io
.
base
.
save
(
_data
,
enroller_file
)
def
load_enroller
(
self
,
enroller_file
):
"""
Loads the test value from file and compares it with the desired one
"""
self
.
_test
(
enroller_file
)
def
enroll
(
self
,
enroll_features
):
"""
Returns the first feature as the model
"""
assert
len
(
enroll_features
)
# just return the first feature
return
enroll_features
[
0
]
def
score
(
self
,
model
,
probe
):
"""
Returns the Euclidean distance between model and probe
"""
return
scipy
.
spatial
.
distance
.
euclidean
(
model
,
probe
)
algorithm
=
DummyAlgorithm
()
This diff is collapsed.
Click to expand it.
bob/bio/base/test/test_scripts.py
+
19
−
0
View file @
347bf423
...
...
@@ -82,6 +82,25 @@ def test_verify_config():
_verify
(
parameters
,
test_dir
,
'
test_config
'
)
def
test_verify_algorithm_noprojection
():
test_dir
=
tempfile
.
mkdtemp
(
prefix
=
'
bobtest_
'
)
# define dummy parameters
parameters
=
[
'
-d
'
,
os
.
path
.
join
(
dummy_dir
,
'
database.py
'
),
'
-p
'
,
os
.
path
.
join
(
dummy_dir
,
'
preprocessor.py
'
),
'
-e
'
,
os
.
path
.
join
(
dummy_dir
,
'
extractor.py
'
),
'
-a
'
,
os
.
path
.
join
(
dummy_dir
,
'
algorithm_noprojection.py
'
),
'
--zt-norm
'
,
'
-vs
'
,
'
algorithm_noprojection
'
,
'
--temp-directory
'
,
test_dir
,
'
--result-directory
'
,
test_dir
]
print
(
bob
.
bio
.
base
.
tools
.
command_line
(
parameters
))
_verify
(
parameters
,
test_dir
,
'
algorithm_noprojection
'
)
def
test_verify_resources
():
test_dir
=
tempfile
.
mkdtemp
(
prefix
=
'
bobtest_
'
)
# define dummy parameters
...
...
This diff is collapsed.
Click to expand it.
develop.cfg
+
20
−
20
View file @
347bf423
...
...
@@ -14,16 +14,16 @@ develop = src/bob.extension
src/bob.blitz
src/bob.core
src/bob.io.base
src/bob.learn.activation
src/bob.math
src/bob.learn.linear
src/bob.sp
src/bob.
learn.em
src/bob.
math
src/bob.measure
src/bob.db.base
src/bob.bio.db
src/bob.db.atnt
src/bob.io.image
src/bob.learn.activation
src/bob.learn.linear
src/bob.learn.em
src/bob.db.atnt
src/bob.bio.db
.
; options for bob.buildout
...
...
@@ -32,20 +32,20 @@ verbose = true
newest
=
false
[sources]
bob.extension
=
git
https://
gitlab.idiap.ch
/
bob/bob.extension
bob.blitz
=
git
https://
gitlab.idiap.ch
/
bob/bob.blitz
bob.core
=
git
https://
gitlab.idiap.ch
/
bob/bob.core
bob.io.base
=
git
https://
gitlab.idiap.ch
/
bob/bob.io.base
bob.
learn.activation
=
git https://
gitlab.idiap.ch
/
bob/bob.
learn.activation
bob.math
=
git
https://
gitlab.idiap.ch
/
bob/bob.math
bob.
sp
=
git https://
gitlab.idiap.ch
/
bob/bob.
sp
bob.
learn.linear
=
git https://
gitlab.idiap.ch
/
bob/bob.
learn.linear
bob.
learn.em
=
git https://
gitlab.idiap.ch
/
bob/bob.
learn.em
bob.
m
ea
sure
=
git https://
gitlab.idiap.ch
/
bob/bob.
m
ea
sure
bob.
db.base
=
git https://
gitlab.idiap.ch
/
bob/bob.
db.base
bob.
bio.db
=
git https://gitlab.idiap.ch/biometric/bob.bio.db
bob.db.atnt
=
git
https://
gitlab.idiap.ch
/
bob/bob.db.atnt
bob.io.
image
=
git
https://
gitlab.idiap.ch
/
bob/bob.io.
image
bob.extension
=
git
git@
gitlab.idiap.ch
:
bob/bob.extension
bob.blitz
=
git
git@
gitlab.idiap.ch
:
bob/bob.blitz
bob.core
=
git
git@
gitlab.idiap.ch
:
bob/bob.core
bob.io.base
=
git
git@
gitlab.idiap.ch
:
bob/bob.io.base
bob.
sp
=
git git@
gitlab.idiap.ch
:
bob/bob.
sp
bob.math
=
git
git@
gitlab.idiap.ch
:
bob/bob.math
bob.
measure
=
git git@
gitlab.idiap.ch
:
bob/bob.
measure
bob.
db.base
=
git git@
gitlab.idiap.ch
:
bob/bob.
db.base
bob.
io.image
=
git git@
gitlab.idiap.ch
:
bob/bob.
io.image
bob.
l
ea
rn.activation
=
git git@
gitlab.idiap.ch
:
bob/bob.
l
ea
rn.activation
bob.
learn.linear
=
git git@
gitlab.idiap.ch
:
bob/bob.
learn.linear
bob.
learn.em
=
git git@gitlab.idiap.ch:bob/bob.learn.em
bob.db.atnt
=
git
git@
gitlab.idiap.ch
:
bob/bob.db.atnt
bob.
b
io.
db
=
git
git@
gitlab.idiap.ch
:
bob/bob.
b
io.
db
[scripts]
recipe
=
bob.buildout:scripts
...
...
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