Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -80,15 +80,13 @@ def infer_video_depth(
|
|
| 80 |
if not os.path.exists(output_dir):
|
| 81 |
os.makedirs(output_dir)
|
| 82 |
|
| 83 |
-
processed_video_path = os.path.join(output_dir, os.path.splitext(video_name)[0]+'
|
| 84 |
-
|
| 85 |
-
save_video(frames, processed_video_path, fps=fps)
|
| 86 |
-
save_video(depths, depth_vis_path, fps=fps, is_depths=True, grayscale=grayscale)
|
| 87 |
|
| 88 |
gc.collect()
|
| 89 |
torch.cuda.empty_cache()
|
| 90 |
|
| 91 |
-
return
|
| 92 |
|
| 93 |
|
| 94 |
def construct_demo():
|
|
@@ -112,14 +110,6 @@ def construct_demo():
|
|
| 112 |
show_share_button=True,
|
| 113 |
scale=5,
|
| 114 |
)
|
| 115 |
-
depth_vis_video = gr.Video(
|
| 116 |
-
label="Generated Depth Video",
|
| 117 |
-
interactive=False,
|
| 118 |
-
autoplay=True,
|
| 119 |
-
loop=True,
|
| 120 |
-
show_share_button=True,
|
| 121 |
-
scale=5,
|
| 122 |
-
)
|
| 123 |
|
| 124 |
with gr.Row(equal_height=True):
|
| 125 |
with gr.Column(scale=1):
|
|
@@ -162,7 +152,7 @@ def construct_demo():
|
|
| 162 |
target_fps,
|
| 163 |
max_res
|
| 164 |
],
|
| 165 |
-
outputs=[processed_video
|
| 166 |
fn=infer_video_depth,
|
| 167 |
cache_examples="lazy",
|
| 168 |
)
|
|
@@ -176,7 +166,7 @@ def construct_demo():
|
|
| 176 |
max_res,
|
| 177 |
grayscale
|
| 178 |
],
|
| 179 |
-
outputs=[processed_video
|
| 180 |
)
|
| 181 |
|
| 182 |
return demo
|
|
|
|
| 80 |
if not os.path.exists(output_dir):
|
| 81 |
os.makedirs(output_dir)
|
| 82 |
|
| 83 |
+
processed_video_path = os.path.join(output_dir, os.path.splitext(video_name)[0]+'.mp4')
|
| 84 |
+
save_video(frames, depths, processed_video_path, fps=fps, grayscale=grayscale)
|
|
|
|
|
|
|
| 85 |
|
| 86 |
gc.collect()
|
| 87 |
torch.cuda.empty_cache()
|
| 88 |
|
| 89 |
+
return processed_video_path
|
| 90 |
|
| 91 |
|
| 92 |
def construct_demo():
|
|
|
|
| 110 |
show_share_button=True,
|
| 111 |
scale=5,
|
| 112 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
with gr.Row(equal_height=True):
|
| 115 |
with gr.Column(scale=1):
|
|
|
|
| 152 |
target_fps,
|
| 153 |
max_res
|
| 154 |
],
|
| 155 |
+
outputs=[processed_video],
|
| 156 |
fn=infer_video_depth,
|
| 157 |
cache_examples="lazy",
|
| 158 |
)
|
|
|
|
| 166 |
max_res,
|
| 167 |
grayscale
|
| 168 |
],
|
| 169 |
+
outputs=[processed_video],
|
| 170 |
)
|
| 171 |
|
| 172 |
return demo
|