cbensimon HF staff commited on
Commit
9a8edc2
1 Parent(s): 1b0f7a1

Like that ?

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -91,17 +91,21 @@ with gr.Blocks() as demo:
91
  animation
92
  )
93
 
 
 
 
 
 
 
 
 
94
  # Examples
95
  gr.Markdown("## Examples")
96
  gr.Examples(
97
- examples=[
98
- ["inputs/applications/source_image/monalisa.png", "inputs/applications/driving/densepose/running.mp4", "inputs/applications/output/monalisa.png"],
99
- ["inputs/applications/source_image/demo4.png", "inputs/applications/driving/densepose/demo4.mp4", "inputs/applications/output/demo4.png"],
100
- ["inputs/applications/source_image/dalle2.jpeg", "inputs/applications/driving/densepose/running2.mp4", "inputs/applications/output/dalle2.jpeg"],
101
- ["inputs/applications/source_image/dalle8.jpeg", "inputs/applications/driving/densepose/dancing2.mp4", "inputs/applications/output/dalle8.jpeg"],
102
- ["inputs/applications/source_image/multi1_source.png", "inputs/applications/driving/densepose/multi_dancing.mp4", "inputs/applications/output/multi1_source.png"],
103
- ],
104
- inputs=[reference_image, motion_sequence, animation],
105
  )
106
 
107
  # demo.queue(max_size=15, api_open=False)
 
91
  animation
92
  )
93
 
94
+ cached_examples = {
95
+ ("inputs/applications/source_image/monalisa.png", "inputs/applications/driving/densepose/running.mp4"): "inputs/applications/output/monalisa.png",
96
+ ("inputs/applications/source_image/demo4.png", "inputs/applications/driving/densepose/demo4.mp4"): "inputs/applications/output/demo4.png",
97
+ ("inputs/applications/source_image/dalle2.jpeg", "inputs/applications/driving/densepose/running2.mp4"): "inputs/applications/output/dalle2.jpeg",
98
+ ("inputs/applications/source_image/dalle8.jpeg", "inputs/applications/driving/densepose/dancing2.mp4"): "inputs/applications/output/dalle8.jpeg",
99
+ ("inputs/applications/source_image/multi1_source.png", "inputs/applications/driving/densepose/multi_dancing.mp4"): "inputs/applications/output/multi1_source.png",
100
+ }
101
+
102
  # Examples
103
  gr.Markdown("## Examples")
104
  gr.Examples(
105
+ fn=lambda image, sequence: cached_examples[(image, sequence)],
106
+ examples=list(cached_examples.keys()),
107
+ inputs=[reference_image, motion_sequence],
108
+ outputs=animation,
 
 
 
 
109
  )
110
 
111
  # demo.queue(max_size=15, api_open=False)