diff --git a/bob/ip/facelandmarks/__init__.py b/bob/ip/facelandmarks/__init__.py index cd0793d187ed609a3e8af6f98e11bd4bd2dccf8d..d5d61f05021867a5aac356dc8a567c2a4a8d4347 100644 --- a/bob/ip/facelandmarks/__init__.py +++ b/bob/ip/facelandmarks/__init__.py @@ -1,8 +1,6 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -#from .utils import * -from .utils import Result def get_config(): @@ -14,19 +12,6 @@ def get_config(): return bob.extension.get_config(__name__) -# gets sphinx autodoc done right - don't remove it -def __appropriate__(*args): - """Says object was actually declared here, an not on the import module. - - Parameters: *args: An iterable of objects to modify - - Resolves `Sphinx referencing issues <https://github.com/sphinx-doc/sphinx/issues/3048>` """ - - for obj in args: obj.__module__ = __name__ - -__appropriate__( - Result, - ) # gets sphinx autodoc done right - don't remove it __all__ = [_ for _ in dir() if not _.startswith('_')] diff --git a/bob/ip/facelandmarks/script/detect_landmarks.py b/bob/ip/facelandmarks/script/detect_landmarks.py index 12670f8415bcc48ef2dd8047c2379632e9056358..d468a26d363b00b275c30745204a25ea4175e095 100644 --- a/bob/ip/facelandmarks/script/detect_landmarks.py +++ b/bob/ip/facelandmarks/script/detect_landmarks.py @@ -87,7 +87,7 @@ def main(user_input=None): if args['--verbose'] == 1: logging.getLogger().setLevel(logging.INFO) elif args['--verbose'] >= 2: logging.getLogger().setLevel(logging.DEBUG) - from .. import detect_landmarks, draw_landmarks, save_landmarks + from bob.ip.facelandmarks.utils import detect_landmarks, draw_landmarks, save_landmarks data = bob.io.base.load(args['<input>']) top = int(args['--limit-to']) diff --git a/bob/ip/facelandmarks/test.py b/bob/ip/facelandmarks/test.py index 767e5129909cef1b46e1d38a283b3dc34cca7a0a..1cda85c094800bed825fe4ca37884529a0be7427 100644 --- a/bob/ip/facelandmarks/test.py +++ b/bob/ip/facelandmarks/test.py @@ -13,8 +13,8 @@ import pkg_resources import bob.io.base import bob.io.base.test_utils -from .utils import detect_landmarks, draw_landmarks -from .utils import detect_landmarks_on_boundingbox +from bob.ip.facelandmarks.utils import detect_landmarks, draw_landmarks, save_landmarks, Result +from bob.ip.facelandmarks.utils import detect_landmarks_on_boundingbox from .script.detect_landmarks import main as app diff --git a/bob/ip/facelandmarks/utils.py b/bob/ip/facelandmarks/utils.py index e354e3031fec20064b5a8c6db7072446534536b2..b86638b37ed3ee27590fd6318127ba1124e5938d 100644 --- a/bob/ip/facelandmarks/utils.py +++ b/bob/ip/facelandmarks/utils.py @@ -186,7 +186,7 @@ def _detect_multiple_landmarks_on_gray_image(data, top=0, min_quality=0.): Returns: - list: A list of named tuples of type :py:class:`Result`, each containing + list: A list of named tuples of type :py:class:`bob.ip.facelandmarks.utils.Result`, each containing the result of face detection and landmarks extracted from the input image. The list MAY BE EMPTY if no face is detected in the input image (data). @@ -278,7 +278,7 @@ def _detect_multiple_landmarks_on_color_image(data, top=0, min_quality=0.): Returns: - list: A list of named tuples of type :py:class:`Result`, each containing + list: A list of named tuples of type :py:class:`bob.ip.facelandmarks.utils.Result`, each containing the result of face detection and landmarks extracted from the input image. @@ -313,7 +313,7 @@ def detect_landmarks(data, top=0, min_quality=0.): Returns: - list: A list of named tuples of type :py:class:`Result`, each containing + list: A list of named tuples of type :py:class:`bob.ip.facelandmarks.utils.Result`, each containing the result of face detection and landmarks extracted from the input image. @@ -335,7 +335,7 @@ def draw_landmarks(data, results): dimensions, corresponding to a either a gray-scale or color image loaded with Bob. - results (list): A list of named tuples of type :py:class:`Result`, each + results (list): A list of named tuples of type :py:class:`bob.ip.facelandmarks.utils.Result`, each containing the result of face detection and landmarks extracted from the input image. @@ -395,7 +395,7 @@ def save_landmarks(results, fname): Parameters: - results (list): A list of named tuples of type :py:class:`Result`, each + results (list): A list of named tuples of type :py:class:`bob.ip.facelandmarks.utils.Result`, each containing the result of face detection and landmarks extracted from the input image. diff --git a/doc/plot/single_face_lmks.py b/doc/plot/single_face_lmks.py index 856181d5200e647b17dd3a4b8bc7c180c4485907..6022d628d427d22b7999a158a80a65bf82cdc92c 100644 --- a/doc/plot/single_face_lmks.py +++ b/doc/plot/single_face_lmks.py @@ -10,6 +10,8 @@ import bob.io.video import bob.ip.color import bob.ip.facelandmarks as menpo +from bob.ip.facelandmarks.utils import detect_landmarks, draw_landmarks, save_landmarks, Result +from bob.ip.facelandmarks.utils import detect_landmarks_on_boundingbox from PIL import Image, ImageDraw from bob.ip.draw import box, cross, plus