summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-16 15:46:23 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-16 15:46:23 +0100
commit105083925c1fd67da5ce580021f8ec7a1497f7f7 (patch)
tree17c4a84d6632d6d599839e4b19bead16a4f729d6
parent1cc66b6afd36f41776c6c649eb1088dbb7caf1c7 (diff)
tag :(
-rw-r--r--cli/app/commands/biggan/extract_dense_vectors.py2
-rw-r--r--cli/app/search/search_dense.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/cli/app/commands/biggan/extract_dense_vectors.py b/cli/app/commands/biggan/extract_dense_vectors.py
index 707b99d..7d11e18 100644
--- a/cli/app/commands/biggan/extract_dense_vectors.py
+++ b/cli/app/commands/biggan/extract_dense_vectors.py
@@ -48,7 +48,7 @@ def cli(ctx, opt_folder_id, opt_latent_steps, opt_dense_steps, opt_video, opt_re
print("Processing folder {} ({}), {} new files".format(folder['name'], folder['id'], len(unprocessed_files)))
- tag = "folder_{}".format(folder['id'])
+ tag = "folder_{}_{}".format(folder['id'], timestamp())
paths = [file['path'] for file in unprocessed_files]
opt_feature_layers = opt_feature_layers.split(',')
diff --git a/cli/app/search/search_dense.py b/cli/app/search/search_dense.py
index 1e1c836..36fc230 100644
--- a/cli/app/search/search_dense.py
+++ b/cli/app/search/search_dense.py
@@ -425,7 +425,7 @@ def find_dense_embedding_for_images(params, opt_tag="inverse_" + timestamp(), op
inv_batch = vs.interleave(vs.data2img(image_batch[BATCH_SIZE - SAMPLE_SIZE:]),
vs.data2img(gen_images[BATCH_SIZE - SAMPLE_SIZE:]))
inv_batch = vs.grid_transform(inv_batch)
- vs.save_image('{}/progress_{}_{:04d}.png'.format(SAMPLES_DIR, params.tag, int(it / 500)), inv_batch)
+ vs.save_image('{}/progress_{}_{:04d}.png'.format(SAMPLES_DIR, opt_tag, int(it / 500)), inv_batch)
it += 1
@@ -445,7 +445,7 @@ def find_dense_embedding_for_images(params, opt_tag="inverse_" + timestamp(), op
image = Image.fromarray(images[i])
fp = BytesIO()
image.save(fp, format='png')
- data = upload_bytes_to_cortex(params.folder_id, "{}-{}.png".format(sample_fn, tag), fp, "image/png")
+ data = upload_bytes_to_cortex(params.folder_id, "{}-{}.png".format(sample_fn, opt_tag), fp, "image/png")
print(json.dumps(data, indent=2))
if data is not None and 'files' in data:
file_id = data['files'][0]['id']