From 3e12bbb43ef865542a03a483dca10c09569bad74 Mon Sep 17 00:00:00 2001 From: zhiltsov-max Date: Tue, 28 Jul 2020 11:16:29 +0300 Subject: [PATCH] Fix convert command (#1943) --- datumaro/datumaro/cli/commands/convert.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/datumaro/datumaro/cli/commands/convert.py b/datumaro/datumaro/cli/commands/convert.py index 089999c74f7f..d867614d09dd 100644 --- a/datumaro/datumaro/cli/commands/convert.py +++ b/datumaro/datumaro/cli/commands/convert.py @@ -67,9 +67,9 @@ def convert_command(args): except KeyError: raise CliException("Converter for format '%s' is not found" % \ args.output_format) - if hasattr(converter, 'from_cmdline'): - extra_args = converter.from_cmdline(args.extra_args) - converter = converter(**extra_args) + extra_args = converter.from_cmdline(args.extra_args) + def converter_proxy(extractor, save_dir): + return converter.convert(extractor, save_dir, **extra_args) filter_args = FilterModes.make_filter_args(args.filter_mode) @@ -127,7 +127,7 @@ def convert_command(args): log.info("Exporting the dataset") dataset.export_project( save_dir=dst_dir, - converter=converter, + converter=converter_proxy, filter_expr=args.filter, **filter_args)