Pie31415 commited on
Commit
e3803af
1 Parent(s): 02ec812

updated app

Browse files
Files changed (2) hide show
  1. app.py +16 -6
  2. 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
- video_inputs = [gr.Video(), gr.Image()]
145
- pass
 
 
 
146
 
147
  gr.Examples(
148
- examples=[["./examples/lincoln.jpg", "./examples/taras2.jpg"]],
149
- inputs=[source_img, driver_img]
 
 
 
 
 
 
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