summaryrefslogtreecommitdiff
path: root/rpc/img_ops.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpc/img_ops.py')
-rw-r--r--rpc/img_ops.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/rpc/img_ops.py b/rpc/img_ops.py
index 6a96e61..e86d91e 100644
--- a/rpc/img_ops.py
+++ b/rpc/img_ops.py
@@ -133,18 +133,19 @@ def mix_next_image(opt, data_opt, rpc_client, im, i, sequence, sequence_i):
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), meta, A_img, data_opt.output_format)
- if data_opt.send_image == 'recursive':
- pil_im = Image.fromarray(next_im)
- rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, pil_im, data_opt.output_format)
+ img_to_send = None
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), meta, pil_im, data_opt.output_format)
+ img_to_send = Image.fromarray(rgb_im)
if data_opt.send_image == 'b':
- image_pil = Image.fromarray(im, mode='RGB')
- rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, image_pil, data_opt.output_format)
+ img_to_send = Image.fromarray(im, mode='RGB')
+ if data_opt.send_image == 'sequence':
+ img_to_send = A_img
+ if data_opt.send_image == 'recursive':
+ img_to_send = Image.fromarray(next_im)
+
+ if img_to_send is not None:
+ rpc_client.send_pil_image("frame_{:05d}.png".format(i+1), meta, img_to_send, data_opt.output_format)
cv2.imwrite(tmp_path, next_img)
os.rename(tmp_path, next_path)