From ebb53f471e8c7a1d226535e1c6fb66f9fdfc65b8 Mon Sep 17 00:00:00 2001
From: Laurent COLBOIS <lcolbois@.idiap.ch>
Date: Mon, 21 Dec 2020 19:46:04 +0100
Subject: [PATCH] Add warning in default cropping positions when receiving an
 unknown annotation type

---
 bob/bio/face/config/baseline/helpers.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bob/bio/face/config/baseline/helpers.py b/bob/bio/face/config/baseline/helpers.py
index 0efd25b8..d506c1d6 100644
--- a/bob/bio/face/config/baseline/helpers.py
+++ b/bob/bio/face/config/baseline/helpers.py
@@ -4,7 +4,8 @@ from bob.bio.base.wrappers import wrap_sample_preprocessor
 from bob.pipelines import wrap
 from bob.bio.face.helpers import face_crop_solver
 import numpy as np
-
+import logging
+logger = logging.getLogger(__name__)
 
 def embedding_transformer_default_cropping(cropped_image_size, annotation_type):
     """
@@ -77,6 +78,7 @@ def embedding_transformer_default_cropping(cropped_image_size, annotation_type):
 
     else:
 
+        logger.warning(f"Annotation type {annotation_type} is not handled. Input images will be fully scaled.")
         cropped_positions = None
 
     return cropped_positions
@@ -135,6 +137,7 @@ def legacy_default_cropping(cropped_image_size, annotation_type):
 
     else:
 
+        logger.warning(f"Annotation type {annotation_type} is not handled. Input images will be fully scaled.")
         cropped_positions = None
 
     return cropped_positions
-- 
GitLab