Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.face
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.face
Commits
3f377801
There was a problem fetching the pipeline summary.
Commit
3f377801
authored
8 years ago
by
Amir Mohammadi
Browse files
Options
Downloads
Patches
Plain Diff
[replaymobile] Fix annotation check
parent
a040e17c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!15
Resolve "Some database interfaces do not provide access to the annotations stored in the low-level databases", Add replay mobile bob.db.replaymobile
Pipeline
#
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/face/database/replaymobile.py
+4
-3
4 additions, 3 deletions
bob/bio/face/database/replaymobile.py
bob/bio/face/test/test_databases.py
+11
-7
11 additions, 7 deletions
bob/bio/face/test/test_databases.py
with
15 additions
and
10 deletions
bob/bio/face/database/replaymobile.py
+
4
−
3
View file @
3f377801
...
...
@@ -46,11 +46,12 @@ class ReplayMobileBioDatabase(BioDatabase):
def
annotations
(
self
,
myfile
):
"""
Will return the bounding box annotation of nth frame of the video.
"""
fn
=
myfile
.
_f
.
framen
# 10th frame number
fn
=
myfile
.
_f
.
framen
annots
=
myfile
.
_f
.
_f
.
bbx
(
directory
=
self
.
original_directory
)
# convert width and height to bottomright coordinates
# bob uses the (y, x) format
topleft
=
(
annots
[
fn
][
2
],
annots
[
fn
][
1
])
bottomright
=
(
annots
[
fn
][
2
]
+
annots
[
fn
][
4
],
annots
[
fn
][
1
]
+
annots
[
fn
][
3
])
topleft
=
(
annots
[
fn
][
1
],
annots
[
fn
][
0
])
bottomright
=
(
annots
[
fn
][
1
]
+
annots
[
fn
][
3
],
annots
[
fn
][
0
]
+
annots
[
fn
][
2
])
annotations
=
{
'
topleft
'
:
topleft
,
'
bottomright
'
:
bottomright
}
return
annotations
...
...
This diff is collapsed.
Click to expand it.
bob/bio/face/test/test_databases.py
+
11
−
7
View file @
3f377801
...
...
@@ -25,13 +25,17 @@ from bob.bio.base.test.utils import db_available
from
bob.bio.base.test.test_database_implementations
import
check_database
,
check_database_zt
def
_check_annotations
(
database
):
def
_check_annotations
(
database
,
topleft
=
False
):
for
file
in
database
.
all_files
():
annotations
=
database
.
annotations
(
file
)
if
annotations
is
not
None
:
assert
isinstance
(
annotations
,
dict
)
assert
'
reye
'
in
annotations
assert
'
leye
'
in
annotations
if
topleft
:
assert
'
topleft
'
in
annotations
assert
'
bottomright
'
in
annotations
else
:
assert
'
reye
'
in
annotations
assert
'
leye
'
in
annotations
@db_available
(
'
arface
'
)
...
...
@@ -210,7 +214,7 @@ def test_replay_licit():
database
=
bob
.
bio
.
base
.
load_resource
(
'
replay-img-licit
'
,
'
database
'
,
preferred_package
=
'
bob.bio.face
'
)
try
:
check_database
(
database
,
groups
=
(
'
dev
'
,
'
eval
'
))
_check_annotations
(
database
)
_check_annotations
(
database
,
topleft
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
...
...
@@ -221,7 +225,7 @@ def test_replay_spoof():
database
=
bob
.
bio
.
base
.
load_resource
(
'
replay-img-spoof
'
,
'
database
'
,
preferred_package
=
'
bob.bio.face
'
)
try
:
check_database
(
database
,
groups
=
(
'
dev
'
,
'
eval
'
))
_check_annotations
(
database
)
_check_annotations
(
database
,
topleft
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
...
...
@@ -232,7 +236,7 @@ def test_replaymobile_licit():
database
=
bob
.
bio
.
base
.
load_resource
(
'
replaymobile-img-licit
'
,
'
database
'
,
preferred_package
=
'
bob.bio.face
'
)
try
:
check_database
(
database
,
groups
=
(
'
dev
'
,
'
eval
'
))
_check_annotations
(
database
)
_check_annotations
(
database
,
topleft
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
...
...
@@ -243,7 +247,7 @@ def test_replaymobile_spoof():
database
=
bob
.
bio
.
base
.
load_resource
(
'
replaymobile-img-spoof
'
,
'
database
'
,
preferred_package
=
'
bob.bio.face
'
)
try
:
check_database
(
database
,
groups
=
(
'
dev
'
,
'
eval
'
))
_check_annotations
(
database
)
_check_annotations
(
database
,
topleft
=
True
)
except
IOError
as
e
:
raise
SkipTest
(
"
The database could not be queried; probably the db.sql3 file is missing. Here is the error:
'
%s
'"
%
e
)
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