From 89c9c8c8786419fbd78db0bc591c28f93fd622dc Mon Sep 17 00:00:00 2001 From: Guillaume HEUSCH <guillaume.heusch@idiap.ch> Date: Tue, 26 Jun 2018 10:57:10 +0200 Subject: [PATCH] [chrom, base] fixed parameters / arguments names and default values --- bob/rppg/base/script/compute_performance.py | 10 +++++----- bob/rppg/base/script/frequency_analysis.py | 15 ++++++-------- bob/rppg/chrom/script/extract_pulse.py | 22 ++++++++++----------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/bob/rppg/base/script/compute_performance.py b/bob/rppg/base/script/compute_performance.py index b120996..687f926 100644 --- a/bob/rppg/base/script/compute_performance.py +++ b/bob/rppg/base/script/compute_performance.py @@ -18,12 +18,12 @@ Options: -V, --version Show version -v, --verbose Increases the verbosity (may appear multiple times) -P, --plot Set this flag if you'd like to see some plots. - -p, --protocol=<string> Protocol [default: all]. + -p, --protocol=<string> Protocol. -s, --subset=<string> Data subset to load. If nothing is provided all the data sets will be loaded. - -i, --hrdir=<path> The path to the saved heart rate values on your disk. - -o, --resultdir=<path> The path to the output directory where the results - will be stored [default: performances]. + -i, --hrdir=<path> The path to the saved heart rate values on your disk [default: hr]. + -o, --resultdir=<path> The path to the output directory where the results + will be stored [default: results]. -O, --overwrite By default, we don't overwrite existing files. Set this flag if you want to overwrite existing files. @@ -71,7 +71,7 @@ def main(user_input=None): configuration = load([os.path.join(args['<configuration>'])]) # get various parameters, either from config file or command-line - protocol = get_parameter(args, configuration, 'protocol', '') + protocol = get_parameter(args, configuration, 'protocol', 'None') subset = get_parameter(args, configuration, 'subset', 'all') hrdir = get_parameter(args, configuration, 'hrdir', 'hr') resultdir = get_parameter(args, configuration, 'resultdir', 'results') diff --git a/bob/rppg/base/script/frequency_analysis.py b/bob/rppg/base/script/frequency_analysis.py index c564721..7a3a619 100644 --- a/bob/rppg/base/script/frequency_analysis.py +++ b/bob/rppg/base/script/frequency_analysis.py @@ -20,13 +20,13 @@ Options: -V, --version Show version -P, --plot Set this flag if you'd like to follow-up the algorithm execution graphically. We'll plot some interactions. - -p, --protocol=<string> Protocol [default: all]. + -p, --protocol=<string> Protocol. -s, --subset=<string> Data subset to load. If nothing is provided all the data sets will be loaded. - -i, --pulsedir=<path> The path to the saved filtered signals on your disk - [default: filtered]. - -o, --hrdir=<path> The path to the output directory where the resulting - color signals will be stored [default: heart-rate]. + -i, --pulsedir=<path> The path to the saved filtered signals on your disk + [default: pulse]. + -o, --hrdir=<path> The path to the output directory where the resulting + color signals will be stored [default: hr]. -O, --overwrite By default, we don't overwrite existing files. The processing will skip those so as to go faster. If you still would like me to overwrite them, set this flag. @@ -83,7 +83,7 @@ def main(user_input=None): configuration = load([os.path.join(args['<configuration>'])]) # get various parameters, either from config file or command-line - protocol = get_parameter(args, configuration, 'protocol', '') + protocol = get_parameter(args, configuration, 'protocol', 'None') subset = get_parameter(args, configuration, 'subset', 'all') pulsedir = get_parameter(args, configuration, 'pulsedir', 'pulse') hrdir = get_parameter(args, configuration, 'hrdir', 'hr') @@ -93,9 +93,6 @@ def main(user_input=None): overwrite = get_parameter(args, configuration, 'overwrite', False) plot = get_parameter(args, configuration, 'plot', False) verbosity_level = get_parameter(args, configuration, 'verbose', 0) - - print(nsegments) - print(nfft) # if the user wants more verbosity, lowers the logging level from bob.core.log import set_verbosity_level diff --git a/bob/rppg/chrom/script/extract_pulse.py b/bob/rppg/chrom/script/extract_pulse.py index cd0edbd..45fd049 100644 --- a/bob/rppg/chrom/script/extract_pulse.py +++ b/bob/rppg/chrom/script/extract_pulse.py @@ -6,7 +6,7 @@ Usage: %(prog)s <configuration> [--protocol=<string>] [--subset=<string> ...] - [--dbdir=<path>] [--outdir=<path>] + [--pulsedir=<path>] [--start=<int>] [--end=<int>] [--motion=<float>] [--threshold=<float>] [--skininit] [--framerate=<int>] [--order=<int>] @@ -23,9 +23,7 @@ Options: -p, --protocol=<string> Protocol. -s, --subset=<string> Data subset to load. If nothing is provided all the data sets will be loaded. - -d, --dbdir=<path> The path to the directory where video sequences are stored - from the face area will be stored [default: pulse] - -o, --outdir=<path> The path to the directory where signal extracted + -o, --pulsedir=<path> The path to the directory where signal extracted from the face area will be stored [default: pulse] --start=<int> Starting frame index [default: 0]. --end=<int> End frame index [default: 0]. @@ -99,12 +97,11 @@ def main(user_input=None): # load configuration file configuration = load([os.path.join(args['<configuration>'])]) - + # get various parameters, either from config file or command-line - protocol = get_parameter(args, configuration, 'protocol', 'all') + protocol = get_parameter(args, configuration, 'protocol', 'None') subset = get_parameter(args, configuration, 'subset', '') - outdir = get_parameter(args, configuration, 'outdir', 'pulse') - dbdir = get_parameter(args, configuration, 'dbdir', '') + pulsedir = get_parameter(args, configuration, 'pulsedir', 'pulse') start = get_parameter(args, configuration, 'start', 0) end = get_parameter(args, configuration, 'end', 0) motion = get_parameter(args, configuration, 'motion', 0.0) @@ -117,12 +114,15 @@ def main(user_input=None): plot = get_parameter(args, configuration, 'plot', False) gridcount = get_parameter(args, configuration, 'gridcount', False) verbosity_level = get_parameter(args, configuration, 'verbose', 0) - + # if the user wants more verbosity, lowers the logging level from bob.core.log import set_verbosity_level set_verbosity_level(logger, verbosity_level) + print(configuration.database) if hasattr(configuration, 'database'): + print(protocol) + print(subset) objects = configuration.database.objects(protocol, subset) else: logger.error("Please provide a database in your configuration file !") @@ -153,7 +153,7 @@ def main(user_input=None): for obj in objects: # expected output file - output = obj.make_path(outdir, '.hdf5') + output = obj.make_path(pulsedir, '.hdf5') # if output exists and not overwriting, skip this file if os.path.exists(output) and not overwrite: @@ -161,7 +161,7 @@ def main(user_input=None): continue # load video - video = obj.load_video(dbdir) + video = obj.load_video(configuration.dbdir) logger.info("Processing input video from `%s'...", video.filename) # indices where to start and to end the processing -- GitLab