jhaoshao commited on
Commit
4bda148
·
1 Parent(s): 504e560

release v1 demo

Browse files
Files changed (3) hide show
  1. app.py +5 -3
  2. gradio_patches/examples.py +13 -0
  3. requirements.txt +1 -1
app.py CHANGED
@@ -38,6 +38,7 @@ import mediapy as media
38
 
39
  from huggingface_hub import login
40
 
 
41
  from chronodepth.unet_chronodepth import DiffusersUNetSpatioTemporalConditionModelChronodepth
42
  from chronodepth.chronodepth_pipeline import ChronoDepthPipeline
43
  from chronodepth.video_utils import resize_max_res, colorize_video_depth
@@ -250,16 +251,17 @@ def run_demo_server(pipe):
250
  elem_id="download",
251
  interactive=False,
252
  )
253
- gr.Examples(
 
254
  examples=[
255
  ["files/elephant.mp4"],
256
  ["files/kitti360_seq_0000.mp4"],
257
  ],
258
  inputs=[video_input],
259
  outputs=[video_output_video, video_output_files],
260
- fn=process_pipe_video,
261
  cache_examples=True,
262
- cache_mode="eager",
263
  )
264
 
265
  video_submit_btn.click(
 
38
 
39
  from huggingface_hub import login
40
 
41
+ from gradio_patches.examples import Examples
42
  from chronodepth.unet_chronodepth import DiffusersUNetSpatioTemporalConditionModelChronodepth
43
  from chronodepth.chronodepth_pipeline import ChronoDepthPipeline
44
  from chronodepth.video_utils import resize_max_res, colorize_video_depth
 
251
  elem_id="download",
252
  interactive=False,
253
  )
254
+ Examples(
255
+ fn=process_pipe_video,
256
  examples=[
257
  ["files/elephant.mp4"],
258
  ["files/kitti360_seq_0000.mp4"],
259
  ],
260
  inputs=[video_input],
261
  outputs=[video_output_video, video_output_files],
262
+
263
  cache_examples=True,
264
+ directory_name="examples_video",
265
  )
266
 
267
  video_submit_btn.click(
gradio_patches/examples.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+
3
+ import gradio
4
+ from gradio.utils import get_cache_folder
5
+
6
+
7
+ class Examples(gradio.helpers.Examples):
8
+ def __init__(self, *args, directory_name=None, **kwargs):
9
+ super().__init__(*args, **kwargs, _initiated_directly=False)
10
+ if directory_name is not None:
11
+ self.cached_folder = get_cache_folder() / directory_name
12
+ self.cached_file = Path(self.cached_folder) / "log.csv"
13
+ self.create()
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  spaces
2
- gradio==5.7.1
3
  diffusers==0.29.1
4
  easydict==1.13
5
  einops==0.8.0
 
1
  spaces
2
+ gradio==4.32.1
3
  diffusers==0.29.1
4
  easydict==1.13
5
  einops==0.8.0