Skip to content
Snippets Groups Projects
Commit 9f709161 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

make tests passing

parent 7b349d91
No related branches found
No related tags found
1 merge request!28Harmonizing algorithms from bob.pad.face and bob.pad.voice, fixes issue#16
Pipeline #
...@@ -16,7 +16,7 @@ from sqlalchemy.ext.declarative import declarative_base ...@@ -16,7 +16,7 @@ from sqlalchemy.ext.declarative import declarative_base
regenerate_database = False 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() Base = declarative_base()
......
#!/usr/bin/env python #!/usr/bin/env python
# vim: set fileencoding=utf-8 : # 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 import numpy as np
from bob.io.base.test_utils import datafile from bob.io.base.test_utils import datafile
from bob.io.base import load from bob.io.base import load
import bob.io.image # for image loading functionality import bob.io.image # for image loading functionality
import bob.bio.video import bob.bio.video
import bob.pad.base
from bob.pad.base.algorithm import SVM from bob.pad.base.algorithm import SVM
import random import random
......
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
# vim: set fileencoding=utf-8 : # vim: set fileencoding=utf-8 :
import numpy as np import numpy as np
import bob.bio.video
import itertools
def convert_frame_cont_to_array(frame_container): def convert_frame_cont_to_array(frame_container):
...@@ -59,8 +62,8 @@ def convert_and_prepare_features(features): ...@@ -59,8 +62,8 @@ def convert_and_prepare_features(features):
if isinstance( if isinstance(
features[0], features[0],
FrameContainer): # if FrameContainer convert to 2D numpy array bob.bio.video.FrameContainer): # if FrameContainer convert to 2D numpy array
return self.convert_list_of_frame_cont_to_array(features) return convert_list_of_frame_cont_to_array(features)
else: else:
return np.vstack(features) return np.vstack(features)
...@@ -87,7 +90,7 @@ def convert_list_of_frame_cont_to_array(frame_containers): ...@@ -87,7 +90,7 @@ def convert_list_of_frame_cont_to_array(frame_containers):
feature_vectors = [] feature_vectors = []
for frame_container in frame_containers: 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) frame_container)
feature_vectors.append(video_features_array) feature_vectors.append(video_features_array)
...@@ -117,8 +120,8 @@ def combinations(input_dict): ...@@ -117,8 +120,8 @@ def combinations(input_dict):
combinations = [ combinations = [
dict(zip(varNames, prod)) dict(zip(varNames, prod))
for prod in it.product(*(input_dict[varName] for prod in itertools.product(*(input_dict[varName]
for varName in varNames)) for varName in varNames))
] ]
return combinations return combinations
...@@ -213,7 +216,6 @@ def convert_array_to_list_of_frame_cont(data): ...@@ -213,7 +216,6 @@ def convert_array_to_list_of_frame_cont(data):
frame_container_list = [] frame_container_list = []
for idx, vec in enumerate(data): for idx, vec in enumerate(data):
frame_container = bob.bio.video.FrameContainer( frame_container = bob.bio.video.FrameContainer(
) # initialize the FrameContainer ) # initialize the FrameContainer
...@@ -223,4 +225,3 @@ def convert_array_to_list_of_frame_cont(data): ...@@ -223,4 +225,3 @@ def convert_array_to_list_of_frame_cont(data):
frame_container) # add current frame to FrameContainer frame_container) # add current frame to FrameContainer
return frame_container_list return frame_container_list
...@@ -32,6 +32,7 @@ requirements: ...@@ -32,6 +32,7 @@ requirements:
run: run:
- python - python
- setuptools - setuptools
- gridtk
test: test:
imports: imports:
...@@ -47,6 +48,7 @@ test: ...@@ -47,6 +48,7 @@ test:
requires: requires:
- bob-devel {{ bob_devel }}.* - bob-devel {{ bob_devel }}.*
- nose - nose
- gridtk
- coverage - coverage
- sphinx - sphinx
- sphinx_rtd_theme - sphinx_rtd_theme
......
...@@ -5,15 +5,16 @@ ...@@ -5,15 +5,16 @@
[buildout] [buildout]
parts = scripts parts = scripts
eggs = bob.pad.base eggs = bob.pad.base
bob.extension
bob.db.base bob.db.base
bob.bio.base bob.bio.base
gridtk
extensions = bob.buildout extensions = bob.buildout
mr.developer mr.developer
auto-checkout = * auto-checkout = *
develop = src/bob.db.base develop = src/bob.db.base
src/bob.bio.base src/bob.bio.base
src/bob.extension
. .
; options for bob.buildout ; options for bob.buildout
...@@ -22,6 +23,7 @@ verbose = true ...@@ -22,6 +23,7 @@ verbose = true
newest = false newest = false
[sources] [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.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 bob.bio.base = git git@gitlab.idiap.ch:bob/bob.bio.base.git
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment