Skip to content

Commit

Permalink
Add converter cli options in project cli
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max committed Dec 12, 2019
1 parent 85d5182 commit 65ec148
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions datumaro/datumaro/cli/project/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ def build_import_parser(parser):
help="Source project format (options: %s)" % (', '.join(importers_list)))
parser.add_argument('-d', '--dest', default='.', dest='dst_dir',
help="Directory to save the new project to (default: current dir)")
parser.add_argument('extra_args', nargs=argparse.REMAINDER,
help="Additional arguments for importer")
parser.add_argument('-n', '--name', default=None,
help="Name of the new project (default: same as project dir)")
parser.add_argument('--overwrite', action='store_true',
help="Overwrite existing files in the save directory")
parser.add_argument('--copy', action='store_true',
help="Make a deep copy instead of saving source links")
# parser.add_argument('extra_args', nargs=argparse.REMAINDER,
# help="Additional arguments for importer (pass '-- -h' for help)")
return parser

def import_command(args):
Expand Down Expand Up @@ -111,8 +111,8 @@ def build_export_parser(parser):
help="Output format")
parser.add_argument('-p', '--project', dest='project_dir', default='.',
help="Directory of the project to operate on (default: current dir)")
parser.add_argument('--save-images', action='store_true',
help="Save images")
parser.add_argument('extra_args', nargs=argparse.REMAINDER, default=None,
help="Additional arguments for converter (pass '-- -h' for help)")
return parser

def export_command(args):
Expand All @@ -125,7 +125,7 @@ def export_command(args):
save_dir=dst_dir,
output_format=args.output_format,
filter_expr=args.filter,
save_images=args.save_images)
cmdline_args=args.extra_args)
log.info("Project exported to '%s' as '%s'" % \
(dst_dir, args.output_format))

Expand Down
3 changes: 1 addition & 2 deletions datumaro/datumaro/components/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def update(self, items):
return self

def save(self, save_dir=None, merge=False, recursive=True,
save_images=False, apply_colormap=True):
save_images=False):
if save_dir is None:
assert self.config.project_dir
save_dir = self.config.project_dir
Expand All @@ -562,7 +562,6 @@ def save(self, save_dir=None, merge=False, recursive=True,

converter_kwargs = {
'save_images': save_images,
'apply_colormap': apply_colormap,
}

if merge:
Expand Down

0 comments on commit 65ec148

Please sign in to comment.