summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-06-14 11:46:58 +0200
committerJules Laplace <julescarbon@gmail.com>2018-06-14 11:46:58 +0200
commitfe6a750bb43ac0170ddb4950d34d04f1f8f22a8c (patch)
treeee26c619a445c0a05d716ea17dd9ca5346525c9d
parent89cb795d1fbc20fd61cfd5d615938d97b3588d08 (diff)
sequence loading
-rw-r--r--live-mogrify.py7
1 files changed, 6 insertions, 1 deletions
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