summaryrefslogtreecommitdiff
path: root/cli/app
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-16 02:56:48 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-16 02:56:48 +0100
commit887c6874ff8d7bf44ea0e039f777234007398b55 (patch)
tree5260c1dfdc02edec96963e1554843e4930c1d3b3 /cli/app
parent6e96d6198f5a7726e135ebae5228646ca8a22f2e (diff)
hopefully all fixed
Diffstat (limited to 'cli/app')
-rw-r--r--cli/app/commands/biggan/extract_dense_vectors.py2
-rw-r--r--cli/app/search/search_dense.py11
2 files changed, 7 insertions, 6 deletions
diff --git a/cli/app/commands/biggan/extract_dense_vectors.py b/cli/app/commands/biggan/extract_dense_vectors.py
index b4300b5..707b99d 100644
--- a/cli/app/commands/biggan/extract_dense_vectors.py
+++ b/cli/app/commands/biggan/extract_dense_vectors.py
@@ -11,7 +11,7 @@ from app.search.json import params_dense_dict
help='Folder ID to process')
@click.option('-ls', '--latent_steps', 'opt_latent_steps', default=1000, type=int,
help='Number of optimization iterations')
-@click.option('-ds', '--dense_steps', 'opt_dense_steps', default=1000, type=int,
+@click.option('-ds', '--dense_steps', 'opt_dense_steps', default=2000, type=int,
help='Number of optimization iterations')
@click.option('-v', '--video', 'opt_video', is_flag=True,
help='Export a video for each dataset')
diff --git a/cli/app/search/search_dense.py b/cli/app/search/search_dense.py
index 066d946..df6edd7 100644
--- a/cli/app/search/search_dense.py
+++ b/cli/app/search/search_dense.py
@@ -431,11 +431,12 @@ def find_dense_embedding_for_images(params, opt_tag="inverse_" + timestamp(), op
# Save images that are ready.
label_trained, latent_trained, enc_trained, rec_err_trained = sess.run([label, latent, encoding, img_rec_err])
- out_lat[out_pos:out_pos+BATCH_SIZE] = latent_trained
- out_enc[out_pos:out_pos+BATCH_SIZE] = enc_trained
- out_images[out_pos:out_pos+BATCH_SIZE] = image_batch
- out_labels[out_pos:out_pos+BATCH_SIZE] = label_trained
- out_err[out_pos:out_pos+BATCH_SIZE] = rec_err_trained
+ count = len(latent_trained)
+ out_lat[out_pos:out_pos+count] = latent_trained
+ out_enc[out_pos:out_pos+count] = enc_trained
+ out_images[out_pos:out_pos+count] = image_batch
+ out_labels[out_pos:out_pos+count] = label_trained
+ out_err[out_pos:out_pos+count] = rec_err_trained
gen_images = sess.run(gen_img_orig)
images = vs.data2img(gen_images)