From 69eb6678fc1c61fdb77f84f25f29ba9f777cd3dd Mon Sep 17 00:00:00 2001 From: Vee9ahd1 Date: Mon, 3 Jun 2019 12:17:29 -0400 Subject: output directory and file prefix (base name) are now handled by different arguments --- gantools/cli.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gantools/cli.py') diff --git a/gantools/cli.py b/gantools/cli.py index 73213ed..0ad3a8d 100644 --- a/gantools/cli.py +++ b/gantools/cli.py @@ -16,7 +16,8 @@ def main(): parser.add_argument('-b', '--nbatch', metavar='N', type=int, help='Number of frames in each \'batch\' \ (note: the truncation value can only change once per batch. Don\'t fuck with this unless you know \ what it does.).', default=1) - parser.add_argument('-f', '--pathprefix', help='Directory path and file prefix for output images.') + parser.add_argument('-o', '--output-dir', help='Directory path for output images.') + parser.add_argument('--prefix', help='File prefix for output images.') args = parser.parse_args() # validate args if args.keys and not (args.username and args.password): @@ -38,8 +39,9 @@ def main(): ims = gan.sample(z_seq, label_seq, truncation_seq, args.nbatch) # save images to file - pathprefix = '' if args.pathprefix == None else str(args.pathprefix) - print('Saving image files: '+pathprefix) - image_utils.save_images(ims, pathprefix) + path = '' if args.output_dir == None else str(args.output_dir) + prefix = '' if args.prefix == None else str(args.prefix) + print('Saving image files: '+path + prefix) + image_utils.save_images(ims, output_dir=output_dir, prefix=prefix) print('Done.') -- cgit v1.2.1