From 6fa56fdd9e8e7dc40fe34591f3c35bdcdf47359e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6ck?= Date: Sun, 5 Feb 2017 08:25:29 +0100 Subject: [PATCH] add 'online' option to single-mode fixes #246 --- madmom/processors.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/madmom/processors.py b/madmom/processors.py index 64802ced8..30c9ec84b 100644 --- a/madmom/processors.py +++ b/madmom/processors.py @@ -509,6 +509,10 @@ def process_single(processor, infile, outfile, **kwargs): """ # pylint: disable=unused-argument + # adjust origin in online mode + if kwargs.get('online'): + kwargs['origin'] = 'online' + kwargs['reset'] = False # process the input file _process((processor, infile, outfile, kwargs)) @@ -808,7 +812,10 @@ def io_arguments(parser, output_suffix='.txt', pickle=True, online=False): default=output, help='output file [default: STDOUT]') sp.add_argument('-j', dest='num_threads', type=int, default=mp.cpu_count(), help='number of parallel threads [default=%(default)s]') - sp.set_defaults(online=None) + # add arguments needed for loading processors + if online: + sp.add_argument('--online', action='store_true', default=None, + help='use online settings [default: offline]') # batch file processing options sp = sub_parsers.add_parser('batch', help='batch file processing')