c2p-cmd commited on
Commit
8a4fd98
·
verified ·
1 Parent(s): 9caef19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -56,7 +56,10 @@ with gr.Blocks() as interface:
56
 
57
  with gr.Tab('Single Watchface Output'):
58
  with gr.Row():
59
- input_file = gr.File(label="Watchface file", file_count='single', file_types=['watchface'])
 
 
 
60
 
61
  with gr.Column():
62
  output_1 = gr.Image(label='Bordered Output', type='filepath')
@@ -67,8 +70,22 @@ with gr.Blocks() as interface:
67
  input_files = gr.File(label="Watchface file", file_count='multiple', file_types=['watchface'])
68
  output_kind_choice = gr.Dropdown(choices=output_kind, value=output_kind[0], label="Output kind for Watchface")
69
 
 
 
70
  output_gallery = gr.Gallery(label='Output Images')
71
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  input_file.upload(
73
  fn=extract_snapshots,
74
  inputs=[input_file],
 
56
 
57
  with gr.Tab('Single Watchface Output'):
58
  with gr.Row():
59
+ with gr.Column():
60
+ input_file = gr.File(label="Watchface file", file_count='single', file_types=['watchface'])
61
+
62
+ single_button = gr.Button(label="Extract", variant="primary")
63
 
64
  with gr.Column():
65
  output_1 = gr.Image(label='Bordered Output', type='filepath')
 
70
  input_files = gr.File(label="Watchface file", file_count='multiple', file_types=['watchface'])
71
  output_kind_choice = gr.Dropdown(choices=output_kind, value=output_kind[0], label="Output kind for Watchface")
72
 
73
+ button = gr.Button(label="Extract", variant="primary")
74
+
75
  output_gallery = gr.Gallery(label='Output Images')
76
 
77
+ single_button.click(
78
+ extract_snapshots,
79
+ inputs=[input_files],
80
+ outputs=[output_1, output_2]
81
+ )
82
+
83
+ button.click(
84
+ extract_snapshots_from,
85
+ inputs=[input_files, output_kind_choice],
86
+ outputs=[output_gallery]
87
+ )
88
+
89
  input_file.upload(
90
  fn=extract_snapshots,
91
  inputs=[input_file],