fffiloni commited on
Commit
bbdc40b
β€’
1 Parent(s): 05e051d

cosmetic changes

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -103,7 +103,7 @@ def infer(video_frames, masks_frames, project_name):
103
  for item in results_folder_content:
104
  print(item)
105
 
106
- return "done", results_folder_content[0], results_folder_content[1]
107
 
108
 
109
  def get_frames(video_in, img_type):
@@ -295,7 +295,7 @@ def infer_auto(project_name, video_in, subject_to_remove):
295
  for item in results_folder_content:
296
  print(item)
297
 
298
- return "done", results_folder_content[0], results_folder_content[1]
299
 
300
  css="""
301
  #col-container{
@@ -318,7 +318,7 @@ with gr.Blocks(css=css) as demo:
318
  with gr.Row():
319
  with gr.Tab("Manual"):
320
  with gr.Column():
321
- project_name = gr.Textbox(label="Name your project", value="my-new-project")
322
  video_frames = gr.File(label="Video frames", file_types=["image"], file_count="multiple")
323
  masks_frames = gr.File(label="Masks frames", file_types=["image"], file_count="multiple")
324
 
@@ -326,20 +326,20 @@ with gr.Blocks(css=css) as demo:
326
 
327
  with gr.Tab("Auto"):
328
  with gr.Column():
329
- project_name_2 = gr.Textbox(label="Name your project", value="my-new-project")
330
  video_in = gr.Video(label="Source video", source="upload", format="mp4")
331
  subject_to_remove = gr.Textbox(label="Subject to remove")
332
 
333
  submit_auto_btn = gr.Button("Submit")
334
 
335
  with gr.Column():
336
- result = gr.Textbox(label="Result")
337
  res_masked = gr.Video(label="Masked video")
338
  res_files = gr.Video(label="Final result")
339
 
340
 
341
 
342
- submit_btn.click(fn=infer, inputs=[video_frames, masks_frames, project_name], outputs=[result, res_masked, res_files])
343
- submit_auto_btn.click(fn=infer_auto, inputs=[project_name_2, video_in, subject_to_remove], outputs=[result, res_masked, res_files])
344
 
345
  demo.queue(max_size=12).launch()
 
103
  for item in results_folder_content:
104
  print(item)
105
 
106
+ return results_folder_content[0], results_folder_content[1]
107
 
108
 
109
  def get_frames(video_in, img_type):
 
295
  for item in results_folder_content:
296
  print(item)
297
 
298
+ return results_folder_content[0], results_folder_content[1]
299
 
300
  css="""
301
  #col-container{
 
318
  with gr.Row():
319
  with gr.Tab("Manual"):
320
  with gr.Column():
321
+ project_name = gr.Textbox(label="Name your project", info="no spaces nor special characters", value="my-new-project")
322
  video_frames = gr.File(label="Video frames", file_types=["image"], file_count="multiple")
323
  masks_frames = gr.File(label="Masks frames", file_types=["image"], file_count="multiple")
324
 
 
326
 
327
  with gr.Tab("Auto"):
328
  with gr.Column():
329
+ project_name_2 = gr.Textbox(label="Name your project", info="no spaces nor special characters", value="my-new-project")
330
  video_in = gr.Video(label="Source video", source="upload", format="mp4")
331
  subject_to_remove = gr.Textbox(label="Subject to remove")
332
 
333
  submit_auto_btn = gr.Button("Submit")
334
 
335
  with gr.Column():
336
+ gr.Markdown("""###Results""")
337
  res_masked = gr.Video(label="Masked video")
338
  res_files = gr.Video(label="Final result")
339
 
340
 
341
 
342
+ submit_btn.click(fn=infer, inputs=[video_frames, masks_frames, project_name], outputs=[res_masked, res_files])
343
+ submit_auto_btn.click(fn=infer_auto, inputs=[project_name_2, video_in, subject_to_remove], outputs=[res_masked, res_files])
344
 
345
  demo.queue(max_size=12).launch()