Commit 0a193444 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV

removing private package cpqd_replay

parent 718e78fe
Pipeline #9037 passed with stages
in 13 minutes and 21 seconds
#!/usr/bin/env python
from bob.pad.voice.database import CPqDReplayPadDatabase
# directory where the wave files are stored
cpqd_input_dir = "[YOUR_CPQD_WAV_DIRECTORY]"
cpqd_input_ext = ".wav"
database = CPqDReplayPadDatabase(
......@@ -5,7 +5,6 @@ from .avspoof import AVspoofPadDatabase
from .replay import ReplayPadDatabase
from .replaymobile import ReplayMobilePadDatabase
from .voicepa import VoicePAPadDatabase
from .cpqd_replay import CPqDReplayPadDatabase
# gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
......@@ -28,7 +27,6 @@ __appropriate__(
__all__ = [_ for _ in dir() if not _.startswith('_')]
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pavel Korshunov <>
# Tue 11 Oct 15:43:22 2016
This is a high level interface for presentation attack CPqD Replay database.
It is an extension of an interface defined inside bob.pad.base PAD framework.
from bob.pad.voice.database import PadVoiceFile
from bob.pad.base.database import PadDatabase
class CPqDReplayPadFile(PadVoiceFile):
def __init__(self, f):
Initializes this File object with a File equivalent from the underlying FileList-based interface for
CPqD Replay database.
attacktype = f.attack_type
if attacktype:
attacktype = str(attacktype)
super(CPqDReplayPadFile, self).__init__(client_id=f.client_id, path=f.path, attack_type=attacktype,
self.__f = f
class CPqDReplayPadDatabase(PadDatabase):
Implements verification API for querying CPqD Replay database.
def __init__(self, protocol='grandtest', **kwargs):
# call base class constructors to open a session to the database
PadDatabase.__init__(self, name='cpqd_replay', protocol=protocol, **kwargs)
from bob.db.cpqd_replay.query import Database as LowLevelDatabase
self.__db = LowLevelDatabase()
# Since the high level API expects different group names than what the low
# level API offers, you need to convert them when necessary
# self.low_level_group_names = ('train', 'dev', 'eval')
# self.high_level_group_names = ('train', 'dev', 'eval')
def objects(self, groups=None, protocol=None, purposes=None, model_ids=None, **kwargs):
"""Returns a set of Files for the specific query by the user.
Keyword Parameters:
One of the groups ('train', 'dev', 'eval') or a tuple with several of them.
If 'None' is given (this is the default), it is considered the same as a
tuple with all possible values.
The protocol for which the clients should be retrieved.
The protocol is dependent on your database.
If you do not have protocols defined, just ignore this field.
The purposes can be either 'real' or 'attack'.
This parameter is not supported in this implementation.
Returns: A set of Files with the specified properties.
# we do not need to convert group names, since we have the same ('train', 'dev', 'eval') names as
# high level API
# matched_groups = self.convert_names_to_lowlevel(
# groups, self.low_level_group_names, self.high_level_group_names)
objects = self.__db.objects(protocol=protocol, groups=groups, purposes=purposes, **kwargs)
return [CPqDReplayPadFile(f) for f in objects]
......@@ -112,7 +112,6 @@ setup(
'avspoof = bob.pad.voice.config.database.avspoof:database',
'asvspoof = bob.pad.voice.config.database.asvspoof:database',
'voicepa = bob.pad.voice.config.database.voicepa:database',
'cpqd_replay = bob.pad.voice.config.database.cpqd_replay:database',
'asvspoof2017 = bob.pad.voice.config.database.asvspoof2017:database',
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment