From e4a32154c0f55f974c8fd210495898cb15027d8c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 11 Jan 2020 02:25:15 +0100 Subject: dense search with args --- cli/app/commands/biggan/search_dense.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'cli/app/commands/biggan') diff --git a/cli/app/commands/biggan/search_dense.py b/cli/app/commands/biggan/search_dense.py index 0cf56a3..b743350 100644 --- a/cli/app/commands/biggan/search_dense.py +++ b/cli/app/commands/biggan/search_dense.py @@ -1,15 +1,22 @@ import click -from app.search.params import Params +from app.search.params import Params, timestamp from app.search.search_dense import find_dense_embedding_for_images @click.command('') @click.option('-i', '--input', 'opt_fp_in', required=True, help='Path to input image') +@click.option('-t', '--tag', 'opt_tag', default="inverse_" + timestamp(), + help='Tag this build') +@click.option('-ll', '--feature_layers', 'opt_feature_layers', default="1a,2a,4a,7a", + help='Feature layers used for loss') +@click.option('-s', '--save_progress', 'opt_save_progress', is_flag=True, + help='Save example images every 500 frames') @click.pass_context -def cli(ctx, opt_fp_in): +def cli(ctx, opt_fp_in, opt_tag, opt_feature_layers, opt_save_progress): """ Search for an image (class vector) in BigGAN using gradient descent """ params = Params(opt_fp_in) - find_dense_embedding_for_images(params) + opt_feature_layers = opt_feature_layers.split(',') + find_dense_embedding_for_images(params, opt_tag=opt_tag, opt_feature_layers=opt_feature_layers, opt_save_progress=opt_save_progress) -- cgit v1.2.3-70-g09d2