Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.face
Commits
23b78dc8
Commit
23b78dc8
authored
Nov 20, 2020
by
Yannick DAYER
Browse files
Add separate annotations type and extension option
parent
f13ed706
Pipeline
#45913
failed with stage
in 31 minutes and 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/face/script/display_face_annotations.py
View file @
23b78dc8
...
...
@@ -55,16 +55,24 @@ Examples:
@
click
.
option
(
"-a"
,
"--annotations-dir"
,
help
=
"If given, use the annotations stored in this directory "
"(when annotated with `$ bob bio annnotate` for example)."
,
help
=
"Use the annotations stored in this directory "
"(when annotated with `$ bob bio annnotate` for example). "
"If not given, will try to load the annotations from the database."
,
)
@
click
.
option
(
"-x"
,
"--annotations-extension"
,
default
=
"json"
,
default
=
"
.
json"
,
show_default
=
True
,
help
=
"Annotations files have the given filename extension."
,
)
@
click
.
option
(
"-t"
,
"--annotations-type"
,
default
=
"json"
,
show_default
=
True
,
help
=
"Annotations type given to bob.bio.base.read_annotations."
,
)
@
click
.
option
(
"-n"
,
"--display-names"
,
...
...
@@ -131,6 +139,7 @@ def display_face_annotations(
is_video
,
annotations_dir
,
annotations_extension
,
annotations_type
,
marker_style
,
marker_size
,
display_names
,
...
...
@@ -193,10 +202,10 @@ def display_face_annotations(
annotations
=
{}
if
annotations_dir
is
not
None
:
# Loads the corresponding annotations file
annotations_file
=
os
.
path
.
join
(
annotations_dir
,
sample
.
key
+
'.'
+
annotations_extension
)
annotations_file
=
os
.
path
.
join
(
annotations_dir
,
sample
.
key
+
annotations_extension
)
if
os
.
path
.
exists
(
annotations_file
):
logger
.
info
(
"Loading annotations from file %s"
,
annotations_file
)
annotations
=
bob
.
db
.
base
.
read_annotation_file
(
annotations_file
,
annotations_
extension
)
annotations
=
bob
.
db
.
base
.
read_annotation_file
(
annotations_file
,
annotations_
type
)
else
:
logger
.
warn
(
"Could not find annotation file %s"
,
annotations_file
)
else
:
...
...
Write
Preview
Markdown
is supported
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