cbensimon HF staff commited on
Commit
547b429
1 Parent(s): 907b1f8

Will work now

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -91,19 +91,19 @@ with gr.Blocks() as demo:
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, video: cached_examples[(image['path'], video['video']['path'])],
106
- examples=[list(key) for key in cached_examples],
107
  inputs=[reference_image, motion_sequence],
108
  outputs=animation,
109
  cache_examples=True,
 
91
  animation
92
  )
93
 
94
+ cached_examples: dict[str, tuple[list[str], str]] = {
95
+ "monalisa": (["inputs/applications/source_image/monalisa.png", "inputs/applications/driving/densepose/running.mp4"], "inputs/applications/output/monalisa.png"),
96
+ "demo4": (["inputs/applications/source_image/demo4.png", "inputs/applications/driving/densepose/demo4.mp4"], "inputs/applications/output/demo4.png"),
97
+ "dalle2.": (["inputs/applications/source_image/dalle2.jpeg", "inputs/applications/driving/densepose/running2.mp4"], "inputs/applications/output/dalle2.jpeg"),
98
+ "dalle8.": (["inputs/applications/source_image/dalle8.jpeg", "inputs/applications/driving/densepose/dancing2.mp4"], "inputs/applications/output/dalle8.jpeg"),
99
+ "multi1_source": (["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, video: cached_examples[image['path'].split('/')[-1].removesuffix('.png')],
106
+ examples=[inputs for inputs, output in cached_examples.values()],
107
  inputs=[reference_image, motion_sequence],
108
  outputs=animation,
109
  cache_examples=True,