Spaces:
Runtime error
Runtime error
Will work now
Browse files
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"
|
96 |
-
("inputs/applications/source_image/demo4.png", "inputs/applications/driving/densepose/demo4.mp4"
|
97 |
-
("inputs/applications/source_image/dalle2.jpeg", "inputs/applications/driving/densepose/running2.mp4"
|
98 |
-
("inputs/applications/source_image/dalle8.jpeg", "inputs/applications/driving/densepose/dancing2.mp4"
|
99 |
-
("inputs/applications/source_image/multi1_source.png", "inputs/applications/driving/densepose/multi_dancing.mp4"
|
100 |
}
|
101 |
|
102 |
# Examples
|
103 |
gr.Markdown("## Examples")
|
104 |
gr.Examples(
|
105 |
-
fn=lambda image, video: cached_examples[
|
106 |
-
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,
|