Commit 0b34b777 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira

Merge branch 'display-annot' into 'master'

Port display-face-annotations script

See merge request !80
parents c566524f c0983e3f
Pipeline #46328 failed with stages
in 7 minutes and 17 seconds
include README.rst bootstrap-buildout.py buildout.cfg develop.cfg LICENSE version.txt requirements.txt
recursive-include doc *.py *.rst
recursive-include bob/bio/face/test/data *.hdf5 *.jpg *.pos *.png
recursive-include bob/bio/face/test/data *.hdf5 *.jpg *.pos *.png *.json
{"topleft": [5.476375102996826, 11.880301475524902], "bottomright": [78.71327209472656, 111.0], "reye": [27.06552505493164, 52.629173278808594], "leye": [61.69809341430664, 51.46814727783203], "nose": [45.439552307128906, 72.81857299804688], "mouthright": [30.882678985595703, 89.54910278320312], "mouthleft": [59.577816009521484, 89.41582489013672], "quality": 0.999476969242096}
\ No newline at end of file
import bob.bio.base.test.utils
import bob.bio.face
from click.testing import CliRunner
import pkg_resources
import tempfile
import shutil
import os
# TODO: Disabling this test until we have bob.bio.base#146
"""
def test_display_annotations():
from bob.bio.face.script.display_face_annotations import main
from bob.bio.face.script.display_face_annotations import display_face_annotations
try:
tmp_dir = tempfile.mkdtemp(prefix="bobtest_")
annotations_dir = pkg_resources.resource_filename(
"bob.bio.face.test",
"data/annotations/"
)
runner = CliRunner()
result = runner.invoke(
display_face_annotations,
args=(
'--database', 'dummy',
'--groups', 'world', '--groups', 'dev',
'--annotations-dir', annotations_dir,
'--output-dir', tmp_dir, '--keep-all',
'--self-test',
)
)
assertion_error_message = (
'Command exited with this output: `{}\' \n'
'If the output is empty, you can run this script locally to see '
'what is wrong:\n'
'$ bob bio display_face_annotations -vvv -d dummy -g world -g dev -a ./annotations/ -o /tmp/temp_annotated'
''.format(result.output))
assert result.exit_code == 0, assertion_error_message
with bob.bio.base.test.utils.Quiet():
parameters = ['-d', 'dummy', '-a', '/very/unlikely/directory', '--self-test']
main(parameters)
"""
# Checks if an annotated sample exists
sample_1_path = os.path.join(tmp_dir, "s1","1.png")
assertion_error_message = "File '{}' not created.".format(sample_1_path)
assert os.path.isfile(sample_1_path), assertion_error_message
finally:
shutil.rmtree(tmp_dir)
......@@ -7,7 +7,6 @@ package:
build:
entry_points:
- display_face_annotations.py = bob.bio.face.script.display_face_annotations:main
number: {{ environ.get('BOB_BUILD_NUMBER', 0) }}
run_exports:
- {{ pin_subpackage(name) }}
......@@ -59,6 +58,7 @@ test:
imports:
- {{ name }}
commands:
- bob bio display-face-annotations --help
- nosetests --with-coverage --cover-package={{ name }} -sv {{ name }}
- sphinx-build -aEW {{ project_dir }}/doc {{ project_dir }}/sphinx
- sphinx-build -aEb doctest {{ project_dir }}/doc sphinx
......
......@@ -195,6 +195,10 @@ setup(
'fargo = bob.bio.face.config.database.fargo',
],
'bob.bio.cli': [
'display-face-annotations = bob.bio.face.script.display_face_annotations:display_face_annotations',
],
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment