Commit 3214c7a8 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Merge branch 'merge-bob.bio' into 'master'

Rewired bob.bio.base and bob.bio.spear to bob.bio.base_legacy and...

See merge request !19
parents e4767a4d 55d9f755
Pipeline #44110 passed with stages
in 9 minutes and 58 seconds
import bob.bio.spear.extractor
import bob.bio.spear_legacy.extractor
"""
This LBP-based feature extraction is implemented based on the paper
......@@ -13,7 +13,7 @@ of the signal. Histogram size is 58 (as lbp_uniform LBP8,1 has 58 different valu
GLCMs are not computed for top and bottom row of the spectrogram. Hence, the resulted size of the feature vector is 2842.
"""
lfcc16_eurecom = bob.bio.spear.extractor.CepstralExtended(
lfcc16_eurecom = bob.bio.spear_legacy.extractor.CepstralExtended(
# the parameters are as specified in the paper by Eurecom
# Federico Alegre, Ravichander Vipperla, Asmaa Amehraye, Nicholas Evans.
# "A new speaker verification spoofing countermeasure based on local binary patterns".
......
import bob.bio.base
import bob.bio.base_legacy
# define a queue with demanding parameters
grid = bob.bio.base.grid.Grid(
grid = bob.bio.base_legacy.grid.Grid(
number_of_preprocessing_jobs=48,
number_of_extraction_jobs=48,
number_of_projection_jobs=48,
......
......@@ -6,7 +6,7 @@
import numpy
# import bob.io.base
from bob.bio.base.extractor import Extractor
from bob.bio.base_legacy.extractor import Extractor
# import bob.io.base
# import bob.ip.base
......
......@@ -3,8 +3,8 @@
# Pavel Korshunov <pavel.korshunov@idiap.ch>
# Tue 15 Nov 15:43:22 CEST 2016
from bob.bio.base.extractor import Extractor
from bob.bio.spear.preprocessor import Base
from bob.bio.base_legacy.extractor import Extractor
from bob.bio.spear_legacy.preprocessor import Base
import numpy
......
......@@ -6,7 +6,7 @@
import numpy
import bob.io.base
from bob.bio.base.extractor import Extractor
from bob.bio.base_legacy.extractor import Extractor
import math
import logging
......@@ -25,8 +25,8 @@ class Ratios(Extractor):
**kwargs)
self.n_bands = n_bands
assert isinstance(features_processor, bob.bio.base.extractor.Extractor), \
"Only feature processors derived from bob.bio.base.extractor.Extractor are supported in this class. "
assert isinstance(features_processor, bob.bio.base_legacy.extractor.Extractor), \
"Only feature processors derived from bob.bio.base_legacy.extractor.Extractor are supported in this class. "
self.features_processor = features_processor
......
......@@ -8,7 +8,7 @@
from __future__ import print_function
import bob.measure
from bob.bio.base.extractor import Extractor
from bob.bio.base_legacy.extractor import Extractor
from .. import utils
import numpy
......
......@@ -18,12 +18,12 @@ class DummyDatabaseTest(unittest.TestCase):
"""Performs various tests on the AVspoof attack database."""
def test00_db_available(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database',
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database',
package_prefix='bob.pad.')
self.assertTrue(db)
def test01_trainFiles(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
files = db.all_files(groups='train')
self.assertEqual(len(files), 2)
names = db.original_file_names(files)
......@@ -34,7 +34,7 @@ class DummyDatabaseTest(unittest.TestCase):
# @db_available
def test02_devFiles(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
files = db.all_files(groups='dev')
self.assertEqual(len(files), 2)
names = db.original_file_names(files)
......@@ -44,7 +44,7 @@ class DummyDatabaseTest(unittest.TestCase):
# @db_available
def test03_evalFiles(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
files = db.all_files(groups='eval')
self.assertEqual(len(files), 2)
names = db.original_file_names(files)
......@@ -54,7 +54,7 @@ class DummyDatabaseTest(unittest.TestCase):
# @db_available
def test04_trainFiles4Test(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
files = db.all_files(groups='train')
self.assertEqual(len(files), 2)
names = db.original_file_names(files)
......@@ -64,7 +64,7 @@ class DummyDatabaseTest(unittest.TestCase):
# @db_available
def test05_scoreFiles(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
files = db.all_files(groups='train')
self.assertEqual(len(files), 2)
names = db.original_file_names(files)
......@@ -74,7 +74,7 @@ class DummyDatabaseTest(unittest.TestCase):
# @db_available
def test06_getAllData(self):
db = bob.bio.base.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
db = bob.bio.base_legacy.load_resource(os.path.join(dummy_dir, 'database.py'), 'database', package_prefix='bob.pad.')
self.assertEqual(len(db.all_files(groups='train')), 2)
self.assertEqual(len(db.all_files(groups='dev')), 2)
self.assertEqual(len(db.all_files(groups='eval')), 2)
......
......@@ -15,9 +15,9 @@ import tempfile
import numpy
import bob.io.base.test_utils
import bob.bio.base
import bob.bio.base_legacy
import bob.pad.base
import bob.bio.spear
import bob.bio.spear_legacy
import bob.pad.voice
import pkg_resources
......@@ -43,7 +43,7 @@ def _spoof(parameters, cur_test_dir, sub_dir, score_types=('dev-real',), scores_
for i in range(0, len(score_types)):
data2check = []
for sfile in (score_files[i], reference_files[i]):
f = bob.bio.base.score.load.open_file(sfile)
f = bob.bio.base_legacy.score.load.open_file(sfile)
d_ = []
for line in f:
if isinstance(line, bytes): line = line.decode('utf-8')
......@@ -86,7 +86,7 @@ def test_spoof_EnergyLBP2():
# define dummy parameters
parameters = [
'-d', 'bob.pad.voice.test.dummy.database.DummyDatabaseSpeechSpoof()',
'-p', 'bob.bio.spear.preprocessor.Mod_4Hz()',
'-p', 'bob.bio.spear_legacy.preprocessor.Mod_4Hz()',
'-e', 'bob.pad.voice.extractor.LBPHistograms(features_processor=bob.pad.voice.extractor.SpectrogramExtended())',
'-a', 'bob.pad.voice.algorithm.LogRegr()',
'-vs', 'test_energylbp',
......
......@@ -7,7 +7,7 @@
from __future__ import print_function
import numpy
import bob.bio.base
import bob.bio.base_legacy
import os.path
import bob.core
......@@ -22,7 +22,7 @@ def load_noattacks_scores(filename):
male_pos = []
# read four column list line by line
for (client_id, probe_id, filename, score) in bob.bio.base.score.load.four_column(filename):
for (client_id, probe_id, filename, score) in bob.bio.base_legacy.score.load.four_column(filename):
if client_id == probe_id:
if 'female' in filename:
female_pos.append(score)
......@@ -47,7 +47,7 @@ def load_attack_scores(scores_filename, support="all", adevice="all", recdevice=
negatives = []
# read four column list line by line
for (client_id, probe_id, filename, score) in bob.bio.base.score.load.four_column(scores_filename):
for (client_id, probe_id, filename, score) in bob.bio.base_legacy.score.load.four_column(scores_filename):
if client_id == probe_id:
# if (support in filename or support == "all") and \
# (adevice in filename or adevice == "all") and \
......@@ -74,7 +74,7 @@ def scores_to_dict(filename, support="all", adevice="all", recdevice="all"):
negatives = {}
# read four column list line by line
for (client_id, probe_id, filename, score) in bob.bio.base.score.load.four_column(filename):
for (client_id, probe_id, filename, score) in bob.bio.base_legacy.score.load.four_column(filename):
if client_id == probe_id:
if (support in filename or support == "all") and \
(adevice in filename or adevice == "all") and \
......
......@@ -25,9 +25,6 @@ requirements:
- bob.io.base
- bob.ip.base
- bob.measure
- bob.bio.base
- bob.bio.spear
- bob.bio.gmm
- bob.pad.base
run:
- python
......
......@@ -6,63 +6,22 @@
parts = scripts
eggs = bob.pad.voice
bob.learn.tensorflow
bob.bio.base
bob.bio.spear
bob.bio.gmm
bob.pad.base
bob.db.base
bob.measure
bob.db.asvspoof
bob.db.asvspoof2017
bob.db.avspoof
bob.db.voicepa
bob.extension
bob.pad.db
bob.bio.db
bob.db.cpqd_replay
gridtk
extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/bob.bio.spear
src/bob.bio.gmm
src/bob.db.asvspoof2017
src/bob.db.asvspoof
src/bob.db.avspoof
src/bob.db.voicepa
src/bob.db.cpqd_replay
src/bob.pad.base
src/bob.bio.base
src/bob.db.base
src/bob.extension
src/bob.bio.db
src/bob.pad.db
bob.learn.tensorflow
/remote/idiap.svm/home.active/pkorshunov/src/bob.learn.tensorflow .
develop = src/bob.pad.base
.
; options for bob.buildout
debug = false
verbose = true
newest = false
[sources]
bob.bio.gmm = git git@gitlab.idiap.ch:bob/bob.bio.gmm.git
bob.db.asvspoof2017 = git git@gitlab.idiap.ch:bob/bob.db.asvspoof2017.git
bob.db.avspoof = git git@gitlab.idiap.ch:bob/bob.db.avspoof.git
bob.db.asvspoof = git git@gitlab.idiap.ch:bob/bob.db.asvspoof.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.pad.base = git git@gitlab.idiap.ch:bob/bob.pad.base.git
bob.db.voicepa = git git@gitlab.idiap.ch:bob/bob.db.voicepa.git
bob.extension = git git@gitlab.idiap.ch:bob/bob.extension.git
bob.bio.db = git git@gitlab.idiap.ch:bob/bob.bio.db.git
bob.pad.db = git git@gitlab.idiap.ch:bob/bob.pad.db.git
bob.bio.spear = git git@gitlab.idiap.ch:bob/bob.bio.spear.git
bob.db.cpqd_replay = git git@gitlab.idiap.ch:bob/bob.db.cpqd_replay.git
bob.learn.tensorflow = fs bob.learn.tensorflow full-path=/remote/idiap.svm/home.active/pkorshunov/src/bob.learn.tensorflow
[scripts]
recipe = bob.buildout:scripts
......
......@@ -130,17 +130,17 @@ setup(
],
'bob.pad.preprocessor': [
'cqcc20p = bob.bio.spear.config.extractor.cqcc20:cqcc20', # Empty preprocessor for CQCC features
'cqcc20p = bob.bio.spear_legacy.config.extractor.cqcc20:cqcc20', # Empty preprocessor for CQCC features
'dummytfp = bob.pad.voice.extractor.dummy_tensorflow:dummytf', # For tensorflow
'energy-2gauss = bob.bio.spear.config.preprocessor.energy_2gauss:preprocessor', # two Gauss energy
'energy-thr = bob.bio.spear.config.preprocessor.energy_thr:preprocessor',
'energy-2gauss = bob.bio.spear_legacy.config.preprocessor.energy_2gauss:preprocessor', # two Gauss energy
'energy-thr = bob.bio.spear_legacy.config.preprocessor.energy_thr:preprocessor',
# thresholded energy
'mod-4hz = bob.bio.spear.config.preprocessor.mod_4hz:preprocessor', # mod_4hz
'external = bob.bio.spear.config.preprocessor.external:preprocessor', # external VAD
'mod-4hz = bob.bio.spear_legacy.config.preprocessor.mod_4hz:preprocessor', # mod_4hz
'external = bob.bio.spear_legacy.config.preprocessor.external:preprocessor', # external VAD
],
'bob.pad.extractor': [
'cqcc20e = bob.bio.spear.config.extractor.cqcc20:cqcc20', # Extractor (reads Matlab files) for CQCC features
'cqcc20e = bob.bio.spear_legacy.config.extractor.cqcc20:cqcc20', # Extractor (reads Matlab files) for CQCC features
'audiotf = bob.pad.voice.extractor.audio_tensorflow:audiotf', # For audio tensorflow
'dummytfe = bob.pad.voice.extractor.dummy_tensorflow:dummytf', # For tensorflow
'glcms = bob.pad.voice.extractor.glcms:extractor',
......@@ -151,19 +151,19 @@ setup(
'ratios = bob.pad.voice.extractor.ratios:extractor',
# SSFCs with delta and delta-delta, plus mod_4hz labels
'ssfc20 = bob.bio.spear.config.extractor.ssfc20:extractor',
'ssfc20 = bob.bio.spear_legacy.config.extractor.ssfc20:extractor',
# SCFCs with delta and delta-delta, plus mod_4hz labels
'scfc20 = bob.bio.spear.config.extractor.scfc20:extractor',
'scfc20 = bob.bio.spear_legacy.config.extractor.scfc20:extractor',
# SCMCs with delta and delta-delta, plus mod_4hz labels
'scmc20 = bob.bio.spear.config.extractor.scmc20:extractor',
'scmc20 = bob.bio.spear_legacy.config.extractor.scmc20:extractor',
# RFCCs with delta and delta-delta, plus mod_4hz labels
'rfcc20 = bob.bio.spear.config.extractor.rfcc20:extractor',
'rfcc20 = bob.bio.spear_legacy.config.extractor.rfcc20:extractor',
# MFCC with delta and delta-delta, plus mod_4hz labels
'mfcc20 = bob.bio.spear.config.extractor.mfcc20:extractor',
'mfcc20 = bob.bio.spear_legacy.config.extractor.mfcc20:extractor',
# IMFCC with delta and delta-delta, plus mod_4hz labels
'imfcc20 = bob.bio.spear.config.extractor.imfcc20:extractor',
'imfcc20 = bob.bio.spear_legacy.config.extractor.imfcc20:extractor',
# LFCCs with delta and delta-delta, plus mod_4hz labels
'lfcc20 = bob.bio.spear.config.extractor.lfcc20:extractor',
'lfcc20 = bob.bio.spear_legacy.config.extractor.lfcc20:extractor',
],
......@@ -177,7 +177,7 @@ setup(
],
'bob.pad.grid': [
'modest = bob.bio.spear.config.grid.modest:grid',
'modest = bob.bio.spear_legacy.config.grid.modest:grid',
],
},
......
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