Commit 97e70380 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

put the simple annotator back

parent e1c15480
Pipeline #17532 passed with stage
in 29 minutes and 29 seconds
......@@ -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'],
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment