From 97e70380ba2702480377148b66b4bc30bf3bb409 Mon Sep 17 00:00:00 2001
From: Amir MOHAMMADI <amir.mohammadi@idiap.ch>
Date: Sat, 10 Mar 2018 09:51:38 +0100
Subject: [PATCH] put the simple annotator back

---
 bob/bio/base/test/dummy/annotator.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/bob/bio/base/test/dummy/annotator.py b/bob/bio/base/test/dummy/annotator.py
index 0a780fee..7d1a968b 100644
--- a/bob/bio/base/test/dummy/annotator.py
+++ b/bob/bio/base/test/dummy/annotator.py
@@ -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'],
 )
-- 
GitLab