Skip to content
Snippets Groups Projects
Commit 0b692afb authored by Manuel Günther's avatar Manuel Günther
Browse files

Fixed scripts to work with the --parallel option as well.

parent 5203c910
Branches
Tags
No related merge requests found
from . import algorithm from . import algorithm
from . import tools from . import tools
from . import test from . import test
from . import script
def get_config(): def get_config():
......
from . import train_gmm
from . import verify_gmm
from . import train_isv
from . import verify_isv
from . import train_ivector
from . import verify_ivector
...@@ -23,9 +23,6 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []): ...@@ -23,9 +23,6 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []):
tools.add_parallel_gmm_options(parsers) tools.add_parallel_gmm_options(parsers)
# override some parameters # override some parameters
parsers['config'].add_argument('-g', '--grid', metavar = 'x', nargs = '+', required=True,
help = 'Configuration for the grid setup; required for the parallel execution script.')
parsers['config'].add_argument('-a', '--algorithm', metavar = 'x', nargs = '+', default = ['gmm'], parsers['config'].add_argument('-a', '--algorithm', metavar = 'x', nargs = '+', default = ['gmm'],
help = 'Face recognition; only GMM-related algorithms are allowed') help = 'Face recognition; only GMM-related algorithms are allowed')
...@@ -49,6 +46,9 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []): ...@@ -49,6 +46,9 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []):
skips = ['preprocessing', 'extractor-training', 'extraction', 'normalization', 'kmeans', 'gmm', 'projection', 'enroller-training', 'enrollment', 'score-computation', 'concatenation', 'calibration'] skips = ['preprocessing', 'extractor-training', 'extraction', 'normalization', 'kmeans', 'gmm', 'projection', 'enroller-training', 'enrollment', 'score-computation', 'concatenation', 'calibration']
) )
if args.grid is None and args.parallel is None:
raise ValueError("To be able to run the parallelized ISV script, either the --grid or the --parallel option need to be specified!")
args.skip_projector_training = True args.skip_projector_training = True
# and add the GMM-related parameters # and add the GMM-related parameters
......
...@@ -23,9 +23,6 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []): ...@@ -23,9 +23,6 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []):
tools.add_parallel_gmm_options(parsers, sub_module = 'isv') tools.add_parallel_gmm_options(parsers, sub_module = 'isv')
# override some parameters # override some parameters
parsers['config'].add_argument('-g', '--grid', metavar = 'x', nargs = '+', required=True,
help = 'Configuration for the grid setup; required for the parallel execution script.')
parsers['config'].add_argument('-a', '--algorithm', metavar = 'x', nargs = '+', default = ['isv'], parsers['config'].add_argument('-a', '--algorithm', metavar = 'x', nargs = '+', default = ['isv'],
help = 'Face recognition; only GMM-related algorithms are allowed') help = 'Face recognition; only GMM-related algorithms are allowed')
...@@ -49,6 +46,9 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []): ...@@ -49,6 +46,9 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []):
skips = ['preprocessing', 'extractor-training', 'extraction', 'normalization', 'kmeans', 'gmm', 'isv', 'projection', 'enroller-training', 'enrollment', 'score-computation', 'concatenation', 'calibration'] skips = ['preprocessing', 'extractor-training', 'extraction', 'normalization', 'kmeans', 'gmm', 'isv', 'projection', 'enroller-training', 'enrollment', 'score-computation', 'concatenation', 'calibration']
) )
if args.grid is None and args.parallel is None:
raise ValueError("To be able to run the parallelized ISV script, either the --grid or the --parallel option need to be specified!")
args.skip_projector_training = True args.skip_projector_training = True
# and add the GMM-related parameters # and add the GMM-related parameters
......
...@@ -23,9 +23,6 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []): ...@@ -23,9 +23,6 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []):
tools.add_parallel_gmm_options(parsers, sub_module = 'ivector') tools.add_parallel_gmm_options(parsers, sub_module = 'ivector')
# override some parameters # override some parameters
parsers['config'].add_argument('-g', '--grid', metavar = 'x', nargs = '+', required=True,
help = 'Configuration for the grid setup; required for the parallel execution script.')
parsers['config'].add_argument('-a', '--algorithm', metavar = 'x', nargs = '+', default = ['ivector'], parsers['config'].add_argument('-a', '--algorithm', metavar = 'x', nargs = '+', default = ['ivector'],
help = 'Face recognition; only GMM-related algorithms are allowed') help = 'Face recognition; only GMM-related algorithms are allowed')
...@@ -49,6 +46,9 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []): ...@@ -49,6 +46,9 @@ def parse_arguments(command_line_parameters, exclude_resources_from = []):
skips = ['preprocessing', 'extractor-training', 'extraction', 'normalization', 'kmeans', 'gmm', 'ivector-training', 'ivector-projection', 'train-whitener', 'whitening-projection', 'train-lda', 'lda-projection', 'train-wccn', 'wccn-projection', 'projection', 'train-plda', 'enroller-training', 'enrollment', 'score-computation', 'concatenation', 'calibration'] skips = ['preprocessing', 'extractor-training', 'extraction', 'normalization', 'kmeans', 'gmm', 'ivector-training', 'ivector-projection', 'train-whitener', 'whitening-projection', 'train-lda', 'lda-projection', 'train-wccn', 'wccn-projection', 'projection', 'train-plda', 'enroller-training', 'enrollment', 'score-computation', 'concatenation', 'calibration']
) )
if args.grid is None and args.parallel is None:
raise ValueError("To be able to run the parallelized ISV script, either the --grid or the --parallel option need to be specified!")
args.skip_projector_training = True args.skip_projector_training = True
# and add the GMM-related parameters # and add the GMM-related parameters
...@@ -175,7 +175,7 @@ def add_ivector_jobs(args, job_ids, deps, submitter): ...@@ -175,7 +175,7 @@ def add_ivector_jobs(args, job_ids, deps, submitter):
dependencies = deps, dependencies = deps,
**args.grid.training_queue) **args.grid.training_queue)
deps.append(job_ids['plda-training']) deps.append(job_ids['plda-training'])
# train PLDA # train PLDA
job_ids['save-projector'] = submitter.submit( job_ids['save-projector'] = submitter.submit(
'--sub-task save-projector', '--sub-task save-projector',
...@@ -183,7 +183,7 @@ def add_ivector_jobs(args, job_ids, deps, submitter): ...@@ -183,7 +183,7 @@ def add_ivector_jobs(args, job_ids, deps, submitter):
dependencies = deps, dependencies = deps,
**args.grid.training_queue) **args.grid.training_queue)
deps.append(job_ids['save-projector']) deps.append(job_ids['save-projector'])
return job_ids, deps return job_ids, deps
...@@ -200,7 +200,7 @@ def execute(args): ...@@ -200,7 +200,7 @@ def execute(args):
# now, check what we can do # now, check what we can do
algorithm = tools.base(args.algorithm) algorithm = tools.base(args.algorithm)
# the file selector object # the file selector object
fs = tools.FileSelector.instance() fs = tools.FileSelector.instance()
...@@ -275,7 +275,7 @@ def execute(args): ...@@ -275,7 +275,7 @@ def execute(args):
tools.train_plda( tools.train_plda(
algorithm, algorithm,
force = args.force) force = args.force)
elif args.sub_task == 'save-projector': elif args.sub_task == 'save-projector':
tools.save_projector( tools.save_projector(
algorithm, algorithm,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment