From fe6a750bb43ac0170ddb4950d34d04f1f8f22a8c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 14 Jun 2018 11:46:58 +0200 Subject: sequence loading --- live-mogrify.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/live-mogrify.py b/live-mogrify.py index 83fb430..c2c38d8 100644 --- a/live-mogrify.py +++ b/live-mogrify.py @@ -250,12 +250,14 @@ class Listener(): self.data_opt.epoch = epoch self.data_opt.load_checkpoint = True return 'ok' - if cmd == 'load_sequence' and os.path.exists('./sequences/' + payload): + if cmd == 'load_sequence' and os.path.exists(os.path.join('./sequences/', opt.module_name, payload)): print('load sequence: {}'.format(payload)) self.data_opt.sequence_name = payload self.data_opt.load_sequence = True + return 'loaded sequence' if cmd == 'seek': self.data_opt.seek_to = payload + return 'seeked' if cmd == 'get_status': return { 'processing': self.data_opt.processing, @@ -266,6 +268,7 @@ class Listener(): if cmd == 'play' and self.data_opt.processing is False: self.data_opt.pause = False process_live_input(self.opt, self.data_opt, self.rpc_client, self.model) + return 'playing' if cmd == 'pause' and self.data_opt.processing is True: self.data_opt.pause = True return 'paused' @@ -331,6 +334,8 @@ def process_live_input(opt, data_opt, rpc_client, model): print("Got sequence {}, {} images, first: {}".format(data_opt.sequence_name, len(sequence), sequence[0])) sequence = new_sequence sequence_i = 1 + else: + print("Sequence not found") if data_opt.seek_to != 1: if data_opt.seek_to > 0 and data_opt.seek_to < len(sequence): sequence_i = data_opt.seek_to -- cgit v1.2.3-70-g09d2