Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Datumaro] Fix convert command #1943

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions datumaro/datumaro/cli/commands/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down