summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-21 03:20:11 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-21 03:20:11 +0200
commit89759f8fd3e29509db9a637af4b31ac078ebed46 (patch)
treed6a9f08d589d664642cc4ef45ce5fea08ed31895
parentcfd0f02611580775dea459cd3b103fc7151f913b (diff)
listen fn
-rw-r--r--live-mogrify.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/live-mogrify.py b/live-mogrify.py
index 6f6a7d3..64031e0 100644
--- a/live-mogrify.py
+++ b/live-mogrify.py
@@ -115,11 +115,8 @@ def process_image(opt, data_opt, im):
img = np.add(array_a, array_b).astype('uint8')
return img
-def process_live_input():
- print("get opt")
+def listen():
opt, data_opt = load_opt()
-
- print("joining rpc")
def set_data_opt(key, value):
data_opt[key] = value
def get_opts():
@@ -127,10 +124,12 @@ def process_live_input():
# args = vars(self.opt)
# for k, v in sorted(args.items()):
# print('%s: %s' % (str(k), str(v)))
-
return vars(data_opt)
- rpc_client = CortexRPC(get_opts, set_data_opt)
+ def activate():
+ process_live_input(opt, data_opt)
+ rpc_client = CortexRPC(get_opts, set_data_opt, activate)
+def process_live_input(opt, data_opt):
A_offset, A_im, A_dir = load_first_frame(opt, data_opt)
data_loader = CreateRecursiveDataLoader(opt)
@@ -220,4 +219,4 @@ def process_live_input():
os.rename(tmp_path, next_path)
if __name__ == '__main__':
- process_live_input() \ No newline at end of file
+ listen() \ No newline at end of file