From 9f709161cc3b72c38ce72d71293b2bfb57821da7 Mon Sep 17 00:00:00 2001 From: Pavel Korshunov <pavel.korshunov@idiap.ch> Date: Tue, 13 Feb 2018 15:13:30 +0100 Subject: [PATCH] make tests passing --- bob/pad/base/test/dummy/database_sql.py | 2 +- bob/pad/base/test/test_algorithms.py | 9 +++++---- bob/pad/base/utils/helper_functions.py | 15 ++++++++------- conda/meta.yaml | 2 ++ develop.cfg | 4 +++- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/bob/pad/base/test/dummy/database_sql.py b/bob/pad/base/test/dummy/database_sql.py index 728eb1c..532c31a 100644 --- a/bob/pad/base/test/dummy/database_sql.py +++ b/bob/pad/base/test/dummy/database_sql.py @@ -16,7 +16,7 @@ from sqlalchemy.ext.declarative import declarative_base regenerate_database = False -dbfile = bob.io.base.test_utils.datafile("test_db.sql3", "bob.pad.base.test") +dbfile = bob.io.base.test_utils.datafile("test_db.sql3", "bob.pad.base.test", path="data") Base = declarative_base() diff --git a/bob/pad/base/test/test_algorithms.py b/bob/pad/base/test/test_algorithms.py index 784a1aa..6059fd0 100644 --- a/bob/pad/base/test/test_algorithms.py +++ b/bob/pad/base/test/test_algorithms.py @@ -1,17 +1,18 @@ #!/usr/bin/env python # vim: set fileencoding=utf-8 : -# @author: Manuel Guenther <Manuel.Guenther@idiap.ch> -# @author: Pavel Korshunov <pavel.korshunov@idiap.ch> -# @date: Tue May 17 12:09:22 CET 2016 # +from __future__ import print_function + import numpy as np + from bob.io.base.test_utils import datafile from bob.io.base import load import bob.io.image # for image loading functionality - import bob.bio.video +import bob.pad.base + from bob.pad.base.algorithm import SVM import random diff --git a/bob/pad/base/utils/helper_functions.py b/bob/pad/base/utils/helper_functions.py index f955904..1f19d59 100644 --- a/bob/pad/base/utils/helper_functions.py +++ b/bob/pad/base/utils/helper_functions.py @@ -2,6 +2,9 @@ # vim: set fileencoding=utf-8 : import numpy as np +import bob.bio.video + +import itertools def convert_frame_cont_to_array(frame_container): @@ -59,8 +62,8 @@ def convert_and_prepare_features(features): if isinstance( features[0], - FrameContainer): # if FrameContainer convert to 2D numpy array - return self.convert_list_of_frame_cont_to_array(features) + bob.bio.video.FrameContainer): # if FrameContainer convert to 2D numpy array + return convert_list_of_frame_cont_to_array(features) else: return np.vstack(features) @@ -87,7 +90,7 @@ def convert_list_of_frame_cont_to_array(frame_containers): feature_vectors = [] for frame_container in frame_containers: - video_features_array = self.convert_frame_cont_to_array( + video_features_array = convert_frame_cont_to_array( frame_container) feature_vectors.append(video_features_array) @@ -117,8 +120,8 @@ def combinations(input_dict): combinations = [ dict(zip(varNames, prod)) - for prod in it.product(*(input_dict[varName] - for varName in varNames)) + for prod in itertools.product(*(input_dict[varName] + for varName in varNames)) ] return combinations @@ -213,7 +216,6 @@ def convert_array_to_list_of_frame_cont(data): frame_container_list = [] for idx, vec in enumerate(data): - frame_container = bob.bio.video.FrameContainer( ) # initialize the FrameContainer @@ -223,4 +225,3 @@ def convert_array_to_list_of_frame_cont(data): frame_container) # add current frame to FrameContainer return frame_container_list - diff --git a/conda/meta.yaml b/conda/meta.yaml index d8aa062..852c823 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -32,6 +32,7 @@ requirements: run: - python - setuptools + - gridtk test: imports: @@ -47,6 +48,7 @@ test: requires: - bob-devel {{ bob_devel }}.* - nose + - gridtk - coverage - sphinx - sphinx_rtd_theme diff --git a/develop.cfg b/develop.cfg index 60554f9..cf077f0 100644 --- a/develop.cfg +++ b/develop.cfg @@ -5,15 +5,16 @@ [buildout] parts = scripts eggs = bob.pad.base + bob.extension bob.db.base bob.bio.base - gridtk extensions = bob.buildout mr.developer auto-checkout = * develop = src/bob.db.base src/bob.bio.base + src/bob.extension . ; options for bob.buildout @@ -22,6 +23,7 @@ verbose = true newest = false [sources] +bob.extension = git git@gitlab.idiap.ch:bob/bob.extension bob.db.base = git git@gitlab.idiap.ch:bob/bob.db.base.git bob.bio.base = git git@gitlab.idiap.ch:bob/bob.bio.base.git -- GitLab