diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-18 15:13:26 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-18 15:13:26 +0200 |
| commit | 5367c1db7b63276363f00ba0f345a844fbc56ead (patch) | |
| tree | 710aaafeb0ab9365b15c39efaa0427b396b0ec14 /rpc/img_ops.py | |
| parent | d03b48d143702c909e01fd0244366cc5b46867e6 (diff) | |
clean
Diffstat (limited to 'rpc/img_ops.py')
| -rw-r--r-- | rpc/img_ops.py | 19 |
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) |
