Spaces:
Build error
Build error
Pie31415
commited on
Commit
·
e3803af
1
Parent(s):
02ec812
updated app
Browse files- app.py +16 -6
- examples/taras1.jpg +0 -0
app.py
CHANGED
|
@@ -136,19 +136,29 @@ with gr.Blocks() as demo:
|
|
| 136 |
|
| 137 |
with gr.Tab("Image Inference"):
|
| 138 |
with gr.Row():
|
| 139 |
-
source_img = gr.Image(type="pil")
|
| 140 |
-
driver_img = gr.Image(type="pil")
|
| 141 |
image_output = gr.Image()
|
| 142 |
image_button = gr.Button("Predict")
|
| 143 |
with gr.Tab("Video Inference"):
|
| 144 |
-
|
| 145 |
-
|
|
|
|
|
|
|
|
|
|
| 146 |
|
| 147 |
gr.Examples(
|
| 148 |
-
examples=[
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
)
|
| 151 |
|
| 152 |
image_button.click(image_inference, inputs=[source_img, driver_img], outputs=image_output)
|
|
|
|
| 153 |
|
| 154 |
demo.launch()
|
|
|
|
| 136 |
|
| 137 |
with gr.Tab("Image Inference"):
|
| 138 |
with gr.Row():
|
| 139 |
+
source_img = gr.Image(type="pil", label="source image", show_label=True)
|
| 140 |
+
driver_img = gr.Image(type="pil", label="driver image", show_label=True)
|
| 141 |
image_output = gr.Image()
|
| 142 |
image_button = gr.Button("Predict")
|
| 143 |
with gr.Tab("Video Inference"):
|
| 144 |
+
with gr.Row():
|
| 145 |
+
source_video = gr.Video(label="source video", )
|
| 146 |
+
driver_image_for_vid = gr.Image(type="pil", label="driver image", show_label=True)
|
| 147 |
+
video_output = gr.Image()
|
| 148 |
+
video_button = gr.Button("Predict")
|
| 149 |
|
| 150 |
gr.Examples(
|
| 151 |
+
examples=[
|
| 152 |
+
["./examples/lincoln.jpg", "./examples/taras2.jpg"],
|
| 153 |
+
["./examples/lincoln.jpg", "./examples/taras1.jpg"]
|
| 154 |
+
],
|
| 155 |
+
inputs=[source_img, driver_img],
|
| 156 |
+
outputs=[image_output],
|
| 157 |
+
fn=image_inference,
|
| 158 |
+
cache_examples=True
|
| 159 |
)
|
| 160 |
|
| 161 |
image_button.click(image_inference, inputs=[source_img, driver_img], outputs=image_output)
|
| 162 |
+
video_button.click(None, inputs=[source_video, driver_image_for_vid], outputs=video_output)
|
| 163 |
|
| 164 |
demo.launch()
|
examples/taras1.jpg
ADDED
|