Skip to content
Snippets Groups Projects
Commit 97e70380 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

put the simple annotator back

parent e1c15480
No related branches found
No related tags found
1 merge request!135Make missing annotations None instead of empty dict
Pipeline #
......@@ -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'],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment