summaryrefslogtreecommitdiff
path: root/cli/app
diff options
context:
space:
mode:
Diffstat (limited to 'cli/app')
-rw-r--r--cli/app/commands/cortex/upload_video.py21
-rw-r--r--cli/app/search/live.py2
2 files changed, 14 insertions, 9 deletions
diff --git a/cli/app/commands/cortex/upload_video.py b/cli/app/commands/cortex/upload_video.py
index f8b9686..6c46d0c 100644
--- a/cli/app/commands/cortex/upload_video.py
+++ b/cli/app/commands/cortex/upload_video.py
@@ -19,15 +19,20 @@ def cli(ctx, opt_fp_in, opt_folder_id):
opt_folder_id = folder['id']
if opt_fp_in is None:
- results_dir = os.path.join(app_cfg.RESULTS_DIR)
- for fn in sorted(os.listdir(app_cfg.RESULTS_DIR), reverse=True):
- fp_frames = os.path.join(app_cfg.RESULTS_DIR, fn)
- if os.path.isdir(f):
+ for fn in sorted(os.listdir(app_cfg.DIR_RESULTS), reverse=True):
+ fp_frames = os.path.join(app_cfg.DIR_RESULTS, fn)
+ if os.path.isdir(fp_frames):
+ opt_fp_in = fp_frames
break
- fp_out = os.path.join(app_cfg.DIR_RENDERS, fn + '.mp4')
- export_video_final(fp_frames, fp_out)
- else:
- fp_out = opt_fp_in
+
+ frames = os.listdir(opt_fp_in)
+ if len(frames) < 10:
+ print("Didn't run long enough, skipping")
+ return
+
+ fp_out = os.path.join(app_cfg.DIR_RENDERS, fn + '.mp4')
+ export_video_final(opt_fp_in, fp_out)
+
if not os.path.exists(fp_out):
print("No video found")
return
diff --git a/cli/app/search/live.py b/cli/app/search/live.py
index 4c66873..ba45e3d 100644
--- a/cli/app/search/live.py
+++ b/cli/app/search/live.py
@@ -374,7 +374,7 @@ class Listener:
interpolator.build()
self.rpc_client.send_status('processing', True)
tag = "biggan_" + timestamp()
- path_out = os.path.join(app_cfg.RESULTS_DIR, tag)
+ path_out = os.path.join(app_cfg.DIR_RESULTS, tag)
os.makedirs(path_out, exist_ok=True)
dt = 1 / FPS
for i in range(99999):