summaryrefslogtreecommitdiff
path: root/cli/app
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app')
-rw-r--r--cli/app/commands/biggan/extract_dense_vectors.py2
-rw-r--r--cli/app/search/live.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/cli/app/commands/biggan/extract_dense_vectors.py b/cli/app/commands/biggan/extract_dense_vectors.py
index 3aa0df4..390bd85 100644
--- a/cli/app/commands/biggan/extract_dense_vectors.py
+++ b/cli/app/commands/biggan/extract_dense_vectors.py
@@ -24,7 +24,7 @@ from app.search.params import timestamp
help='Normalize labels every N steps')
@click.option('-feat', '--use_feature_detector', 'opt_use_feature_detector', is_flag=True,
help='Compute feature loss')
-@click.option('-ll', '--feature_layers', 'opt_feature_layers', default="1a,2a,4a,7a",
+@click.option('-ll', '--feature_layers', 'opt_feature_layers', default="2a,4a,7a",
help='Feature layers used for loss')
@click.option('-snap', '--snapshot_interval', 'opt_snapshot_interval', default=20,
help='Interval to store sample images')
diff --git a/cli/app/search/live.py b/cli/app/search/live.py
index 35fef19..1fd3ddf 100644
--- a/cli/app/search/live.py
+++ b/cli/app/search/live.py
@@ -101,10 +101,13 @@ class SinParam:
orbit_time = InterpolatorParam(name=name + '_time', value=0.0)
if lerp:
noise = LerpParam(name + '_noise', shape=shape, datatype=datatype, ease=easing.LinearInOut)
- output = tf.math.sin(orbit_time.variable + noise.output) * orbit_radius.variable
+ noise_out = noise.output
else:
noise = InterpolatorParam(name + '_noise_a', shape=shape, datatype=datatype)
- output = tf.math.sin(orbit_time.variable + noise.variable) * orbit_radius.variable
+ noise_out = noise.variable
+ sin = tf.math.sin(orbit_time.variable + noise_out) * orbit_radius.variable
+ cos = tf.math.cos(orbit_time.variable + noise_out) * orbit_radius.variable
+ output = sin + cos
interpolator.sin_params[name] = self
self.name = name
self.orbit_speed = orbit_speed
@@ -115,7 +118,7 @@ class SinParam:
self.t = 0
def update(self):
- self.orbit_time.assign((np.pi * 0.25) / self.orbit_speed.value, immediate=True)
+ self.orbit_time.assign((np.pi * 2) / self.orbit_speed.value, immediate=True)
self.t += 1
# randomize the orbit when possible -
# - check if we've done one full orbital period
@@ -484,7 +487,6 @@ class Listener:
gen_time_total = 0
to_pil_time_total = 0
save_time_total = 0
- resize_time_total = 0
send_time_total = 0
for i in range(99999):
if i == 0:
@@ -517,9 +519,7 @@ class Listener:
out_img.save(pipe.stdin, format='png', compression_level=3)
save_time_total += time.time() - save_time
- resize_time = time.time()
img_to_send = out_img.resize((256, 256), Image.BICUBIC)
- resize_time_total += time.time() - resize_time
meta = {
'i': i,
@@ -531,5 +531,5 @@ class Listener:
self.rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, img_to_send, 'jpg')
send_time_total += time.time() - send_time
if (i % 100) == 0 or i == 1:
- print("step: {}, gen: {:.2f}, pil: {:.2f}, save: {:.2f}, resize: {:.2f}, send: {:.2f}".format(i, gen_time_total / i, to_pil_time_total / i, save_time_total / i, resize_time_total / i, send_time_total / i))
+ print("step: {}, gen: {:.2f}, pil: {:.2f}, save: {:.2f}, send: {:.2f}".format(i, gen_time_total / i, to_pil_time_total / i, save_time_total / i, send_time_total / i))