summaryrefslogtreecommitdiff
path: root/live-mogrify.py
diff options
context:
space:
mode:
Diffstat (limited to 'live-mogrify.py')
-rw-r--r--live-mogrify.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/live-mogrify.py b/live-mogrify.py
index bf3975a..b511af1 100644
--- a/live-mogrify.py
+++ b/live-mogrify.py
@@ -273,6 +273,7 @@ def process_live_input(opt, data_opt, rpc_client, model):
tmp_path = opt.render_dir + "frame_{:05d}_tmp.png".format(i+1)
next_path = opt.render_dir + "frame_{:05d}.png".format(i+1)
current_path = opt.render_dir + "ren_{:05d}.png".format(i+1)
+ meta = { 'i': i, 'sequence_i': sequence_i, 'sequence_len': len(sequence) }
if data_opt.sequence and len(sequence):
sequence_path = sequence[sequence_i]
if sequence_i >= len(sequence)-1:
@@ -283,7 +284,7 @@ def process_live_input(opt, data_opt, rpc_client, model):
if data_opt.send_image == 'b':
image_pil = Image.fromarray(im, mode='RGB')
- rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), image_pil)
+ rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, image_pil)
if data_opt.store_a is not True:
os.remove(last_path)
@@ -333,14 +334,14 @@ def process_live_input(opt, data_opt, rpc_client, model):
next_img = process_image(opt, data_opt, next_im)
if data_opt.send_image == 'sequence':
- rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), A_img)
+ rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, A_img)
if data_opt.send_image == 'recursive':
pil_im = Image.fromarray(next_im)
- rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), pil_im)
+ rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, pil_im)
if data_opt.send_image == 'a':
rgb_im = cv2.cvtColor(next_img, cv2.COLOR_BGR2RGB)
pil_im = Image.fromarray(rgb_im)
- rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), pil_im)
+ rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, pil_im)
cv2.imwrite(tmp_path, next_img)
os.rename(tmp_path, next_path)