From a0e5b73e421492dfa3e85e2c47b339122684f5bc Mon Sep 17 00:00:00 2001 From: skbidiap <sushil.bhattacharjee@idiap.ch> Date: Wed, 11 Jan 2017 17:47:27 +0100 Subject: [PATCH] update to fix sphinx problems --- bob/ip/facelandmarks/__init__.py | 15 --------------- bob/ip/facelandmarks/script/detect_landmarks.py | 2 +- bob/ip/facelandmarks/test.py | 4 ++-- bob/ip/facelandmarks/utils.py | 10 +++++----- doc/plot/single_face_lmks.py | 2 ++ 5 files changed, 10 insertions(+), 23 deletions(-) diff --git a/bob/ip/facelandmarks/__init__.py b/bob/ip/facelandmarks/__init__.py index cd0793d..d5d61f0 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 12670f8..d468a26 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 767e512..1cda85c 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 e354e30..b86638b 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 856181d..6022d62 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 -- GitLab