Krokodilpirat commited on
Commit
6cc4593
·
verified ·
1 Parent(s): 19217bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -95,7 +95,7 @@ def infer_video_depth(
95
  depth_vis = np.stack([depth_norm] * 3, axis=-1)
96
  else:
97
  cmap = cm.get_cmap("inferno")
98
- # cmap liefert RGBA wir verwenden die ersten 3 Kanäle und skalieren auf 255
99
  depth_vis = (cmap(depth_norm / 255.0)[..., :3] * 255).astype(np.uint8)
100
  # Apply Gaussian blur if requested (blur factor > 0)
101
  if blur > 0:
@@ -122,7 +122,8 @@ def construct_demo():
122
 
123
  with gr.Row(equal_height=True):
124
  with gr.Column(scale=1):
125
- input_video = gr.Video(label="Input Video", source="upload", type="filepath")
 
126
  with gr.Column(scale=2):
127
  with gr.Row(equal_height=True):
128
  processed_video = gr.Video(label="Preprocessed Video", interactive=False, autoplay=True, loop=True, show_share_button=True, scale=5)
@@ -160,5 +161,5 @@ def construct_demo():
160
 
161
  if __name__ == "__main__":
162
  demo = construct_demo()
163
- demo.queue() # Asynchrone Verarbeitung aktivieren
164
  demo.launch(share=True)
 
95
  depth_vis = np.stack([depth_norm] * 3, axis=-1)
96
  else:
97
  cmap = cm.get_cmap("inferno")
98
+ # cmap returns RGBA; we use only the first 3 channels and scale to 255
99
  depth_vis = (cmap(depth_norm / 255.0)[..., :3] * 255).astype(np.uint8)
100
  # Apply Gaussian blur if requested (blur factor > 0)
101
  if blur > 0:
 
122
 
123
  with gr.Row(equal_height=True):
124
  with gr.Column(scale=1):
125
+ # Hier den Parameter "source" entfernt, sodass nur type="filepath" übrig bleibt.
126
+ input_video = gr.Video(label="Input Video", type="filepath")
127
  with gr.Column(scale=2):
128
  with gr.Row(equal_height=True):
129
  processed_video = gr.Video(label="Preprocessed Video", interactive=False, autoplay=True, loop=True, show_share_button=True, scale=5)
 
161
 
162
  if __name__ == "__main__":
163
  demo = construct_demo()
164
+ demo.queue() # Enable asynchronous processing
165
  demo.launch(share=True)