Modules

class dsdtools.DB(root_dir=None, setup_file=None, evaluation=None, valid_ids=None)[source]

Bases: object

The dsdtools DB Object

Parameters:

root_dir : str, optional

dsdtools Root path. If set to None it will be read from the DSD_PATH environment variable

subsets : str or list, optional

select a _dsdtools_ subset Dev or Test (defaults to both)

setup_file : str, optional

_dsdtools_ Setup file in yaml format. Default is provided dsd100.yaml

evaluation : str, {None, ‘bss_eval’, ‘mir_eval’}

Setup evaluation module and starts matlab if bsseval is enabled

valid_ids : list[int] or int, optional

select single or multiple _dsdtools_ items by ID that will be used for validation data (ie not included in the Dev set)

Attributes

setup_file (str) path to yaml file. default: setup.yaml
root_dir (str) dsdtools Root path. Default is DSD_PATH env
evaluation (bool) Setup evaluation module
mixtures_dir (str) path to Mixture directory
sources_dir (str) path to Sources directory
sources_names (list[str]) list of names of sources
targets_names (list[str]) list of names of targets
evaluator (BSSeval) evaluator used for evaluation of estimates
setup (Dict) loaded yaml configuration

Methods

load_dsd_tracks() Iterates through the dsdtools folder structure and returns Track objects
test(user_function) Test the dsdtools processing
evaluate() Run the evaluation
run(user_function=None, estimates_dir=None, evaluate=False) Run the dsdtools processing, saving the estimates and optionally evaluate them
evaluate(user_function=None, estimates_dir=None, *args, **kwargs)[source]

Run the dsdtools evaluation

shortcut to ``run(

user_function=None, estimates_dir=estimates_dir, evaluate=True

)``

load_dsd_tracks(subsets=None, ids=None)[source]

Parses the dsdtools folder structure and returns Track objects

Parameters:

subsets : list[str], optional

select a _dsdtools_ subset Dev or Test. Defaults to both

ids : list[int] or int, optional

select single or multiple _dsdtools_ items by ID

Returns:

list[Track]

return a list of Track Objects

run(user_function=None, estimates_dir=None, evaluate=False, subsets=None, ids=None, parallel=False, cpus=4)[source]

Run the dsdtools processing

Parameters:

user_function : callable, optional

function which separates the mixture into estimates. If no function is provided (default in None) estimates are loaded from disk when evaluate is True.

estimates_dir : str, optional

path to the user provided estimates. Directory will be created if it does not exist. Default is none which means that the results are not saved.

evaluate : bool, optional

evaluate the estimates by using. Default is False

subsets : list[str], optional

select a _dsdtools_ subset Dev or Test. Defaults to both

ids : list[int] or int, optional

select single or multiple _dsdtools_ items by ID

parallel: bool, optional

activate multiprocessing

cpus: int, optional

set number of cores if parallel mode is active, defaults to 4

Raises:

RuntimeError

If the provided function handle is not callable.

See also

test
Test the user provided function
test(user_function)[source]

Test the dsdtools processing

Parameters:

user_function : callable, optional

function which separates the mixture into estimates. If no function is provided (default in None) estimates are loaded from disk when evaluate is True.

Raises:

TypeError

If the provided function handle is not callable.

ValueError

If the output is not compliant to the bsseval methods

See also

run
Process the dsdtools
dsdtools.init_worker()[source]
dsdtools.process_function_alias(obj, *args, **kwargs)[source]