diff --git a/bob/bio/base/annotator/FailSafe.py b/bob/bio/base/annotator/FailSafe.py index 88af4ddce4b4e37bceaea5051601d10bae4315bb..091e55300e58a467fe5b06170d66f71029ae4746 100644 --- a/bob/bio/base/annotator/FailSafe.py +++ b/bob/bio/base/annotator/FailSafe.py @@ -1,5 +1,7 @@ import logging +import six from . import Annotator +from .. import load_resource logger = logging.getLogger(__name__) @@ -21,7 +23,11 @@ class FailSafe(Annotator): def __init__(self, annotators, required_keys, **kwargs): super(FailSafe, self).__init__(**kwargs) - self.annotators = list(annotators) + self.annotators = [] + for annotator in annotators: + if isinstance(annotator, six.string_types): + annotator = load_resource(annotator, 'annotator') + self.annotators.append(annotator) self.required_keys = list(required_keys) def annotate(self, sample, **kwargs):