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.bio.base
Commits
97e70380
Commit
97e70380
authored
Mar 10, 2018
by
Amir MOHAMMADI
Browse files
put the simple annotator back
parent
e1c15480
Pipeline
#17532
passed with stage
in 29 minutes and 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/base/test/dummy/annotator.py
View file @
97e70380
...
...
@@ -2,16 +2,18 @@ from random import random
from
bob.bio.base.annotator
import
FailSafe
,
Callable
def
simple_annotator
(
image
,
**
kwargs
):
return
{
'topleft'
:
(
0
,
0
),
'bottomright'
:
image
.
shape
,
}
def
moody_annotator
(
image
,
**
kwargs
):
annot
=
simple_annotator
(
image
,
**
kwargs
)
if
random
()
<
0.5
:
return
{
'topleft'
:
(
0
,
0
),
}
else
:
return
{
'topleft'
:
(
0
,
0
),
'bottomright'
:
image
.
shape
,
}
del
annot
[
'bottomright'
]
return
annot
def
fail_annotator
(
image
,
**
kwargs
):
...
...
@@ -20,6 +22,6 @@ def fail_annotator(image, **kwargs):
annotator
=
FailSafe
(
[
Callable
(
fail_annotator
),
Callable
(
moody
_annotator
)],
Callable
(
simple
_annotator
)],
required_keys
=
[
'topleft'
,
'bottomright'
],
)
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