Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.replaymobile
Commits
5dde6af1
Commit
5dde6af1
authored
Jul 14, 2016
by
Sushil BHATTACHARJEE
Browse files
switched devel and test sets
parent
8481754b
Changes
3
Hide whitespace changes
Inline
Side-by-side
bob/db/replaymobile/create.py
View file @
5dde6af1
...
@@ -219,6 +219,7 @@ def add_command(subparsers):
...
@@ -219,6 +219,7 @@ def add_command(subparsers):
help
=
"Do SQL operations in a verbose way"
)
help
=
"Do SQL operations in a verbose way"
)
parser
.
add_argument
(
'-D'
,
'--protodir'
,
action
=
'store'
,
parser
.
add_argument
(
'-D'
,
'--protodir'
,
action
=
'store'
,
default
=
'/idiap/group/biometric/databases/replay-mobile/database/protocols'
,
default
=
'/idiap/group/biometric/databases/replay-mobile/database/protocols'
,
# default='/idiap/user/sbhatta/work/replay-mobile/database/protocols',
metavar
=
'DIR'
,
metavar
=
'DIR'
,
help
=
"Change the relative path to the directory containing the protocol definitions for replay attacks (defaults to %(default)s)"
)
help
=
"Change the relative path to the directory containing the protocol definitions for replay attacks (defaults to %(default)s)"
)
...
...
bob/db/replaymobile/db.sql3
View file @
5dde6af1
No preview for this file type
bob/db/replaymobile/test.py
View file @
5dde6af1
...
@@ -68,10 +68,10 @@ class ReplayMobileDatabaseTest(unittest.TestCase):
...
@@ -68,10 +68,10 @@ class ReplayMobileDatabaseTest(unittest.TestCase):
dev
=
db
.
objects
(
cls
=
'real'
,
groups
=
'devel'
)
dev
=
db
.
objects
(
cls
=
'real'
,
groups
=
'devel'
)
#self.assertEqual(len(dev), 120) # Still have to capture 1 users (client009)
#self.assertEqual(len(dev), 120) # Still have to capture 1 users (client009)
self
.
assertEqual
(
len
(
dev
),
1
1
0
)
self
.
assertEqual
(
len
(
dev
),
1
6
0
)
test
=
db
.
objects
(
cls
=
'real'
,
groups
=
'test'
)
test
=
db
.
objects
(
cls
=
'real'
,
groups
=
'test'
)
self
.
assertEqual
(
len
(
test
),
1
6
0
)
self
.
assertEqual
(
len
(
test
),
1
1
0
)
#tests train, devel and test files are distinct
#tests train, devel and test files are distinct
s
=
set
(
train
+
dev
+
test
)
s
=
set
(
train
+
dev
+
test
)
...
@@ -92,10 +92,10 @@ class ReplayMobileDatabaseTest(unittest.TestCase):
...
@@ -92,10 +92,10 @@ class ReplayMobileDatabaseTest(unittest.TestCase):
self
.
assertEqual
(
len
(
train
),
int
(
round
(
0.3
*
N
)))
self
.
assertEqual
(
len
(
train
),
int
(
round
(
0.3
*
N
)))
dev
=
db
.
objects
(
cls
=
'attack'
,
groups
=
'devel'
,
protocol
=
protocol
)
dev
=
db
.
objects
(
cls
=
'attack'
,
groups
=
'devel'
,
protocol
=
protocol
)
self
.
assertEqual
(
len
(
dev
),
int
(
round
(
0.
3
*
N
)))
self
.
assertEqual
(
len
(
dev
),
int
(
round
(
0.
4
*
N
)))
test
=
db
.
objects
(
cls
=
'attack'
,
groups
=
'test'
,
protocol
=
protocol
)
test
=
db
.
objects
(
cls
=
'attack'
,
groups
=
'test'
,
protocol
=
protocol
)
self
.
assertEqual
(
len
(
test
),
int
(
round
(
0.
4
*
N
)))
self
.
assertEqual
(
len
(
test
),
int
(
round
(
0.
3
*
N
)))
#tests train, devel and test files are distinct
#tests train, devel and test files are distinct
s
=
set
(
train
+
dev
+
test
)
s
=
set
(
train
+
dev
+
test
)
...
@@ -183,7 +183,37 @@ class ReplayMobileDatabaseTest(unittest.TestCase):
...
@@ -183,7 +183,37 @@ class ReplayMobileDatabaseTest(unittest.TestCase):
self
.
assertEqual
(
main
(
'replaymobile checkfiles --self-test'
.
split
()),
0
)
self
.
assertEqual
(
main
(
'replaymobile checkfiles --self-test'
.
split
()),
0
)
@
db_available
def
test13_queryRealAccesses
(
self
):
db
=
Database
()
trainClients
=
[
'001'
,
'003'
,
'008'
,
'011'
,
'012'
,
'016'
,
'018'
,
'020'
,
'026'
,
'034'
,
'037'
,
'038'
]
develClients
=
[
'005'
,
'006'
,
'013'
,
'014'
,
'015'
,
'023'
,
'024'
,
'025'
,
'028'
,
'029'
,
'031'
,
'032'
,
'035'
,
'036'
,
'039'
,
'040'
]
testClients
=
[
'002'
,
'004'
,
'007'
,
'009'
,
'010'
,
'017'
,
'019'
,
'021'
,
'022'
,
'027'
,
'030'
,
'033'
]
f
=
db
.
objects
(
cls
=
'real'
)
self
.
assertEqual
(
len
(
f
),
390
)
train
=
db
.
objects
(
cls
=
'real'
,
groups
=
'train'
)
self
.
assertEqual
(
len
(
train
),
120
)
for
cl
in
train
:
clFilename
=
cl
.
videofile
(
""
)
clientPos
=
clFilename
.
find
(
'client'
)
clientId
=
clFilename
[
clientPos
+
6
:
clientPos
+
9
]
self
.
assertTrue
(
clientId
in
trainClients
)
dev
=
db
.
objects
(
cls
=
'real'
,
groups
=
'devel'
)
self
.
assertEqual
(
len
(
dev
),
160
)
for
cl
in
dev
:
clFilename
=
cl
.
videofile
(
""
)
clientPos
=
clFilename
.
find
(
'client'
)
clientId
=
clFilename
[
clientPos
+
6
:
clientPos
+
9
]
self
.
assertTrue
(
clientId
in
develClients
)
test
=
db
.
objects
(
cls
=
'real'
,
groups
=
'test'
)
self
.
assertEqual
(
len
(
test
),
110
)
for
cl
in
test
:
clFilename
=
cl
.
videofile
(
""
)
clientPos
=
clFilename
.
find
(
'client'
)
clientId
=
clFilename
[
clientPos
+
6
:
clientPos
+
9
]
self
.
assertTrue
(
clientId
in
testClients
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment