Adityadn commited on
Commit
32f583d
·
verified ·
1 Parent(s): c4eff41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -14
app.py CHANGED
@@ -182,17 +182,24 @@ def interrogatorFunction(img, value):
182
  print(output)
183
  return output
184
 
185
- ui = gr.Interface(
186
- fn=interrogatorFunction,
187
- inputs=[
188
- grh.Image(label='Input', source='upload', type='numpy'),
189
- gr.Radio(
190
- label='Content Type',
191
- choices=[flags.desc_type_photo, flags.desc_type_anime],
192
- value=flags.desc_type_photo
193
- )
194
- ],
195
- outputs=gr.Textbox(type="text", label="Output", show_copy_button=True)
196
- )
197
-
198
- ui.launch()
 
 
 
 
 
 
 
 
182
  print(output)
183
  return output
184
 
185
+ describe = gr.Blocks(title="AI Describe Image", css="#component-3, #component-5 {display: grid; align-content: center;}")
186
+
187
+ with describe:
188
+ describe_tab = gr.TabItem(label='Describe')
189
+ with describe_tab:
190
+ input_column = gr.Row()
191
+ with input_column:
192
+ with gr.Column():
193
+ input_image = grh.Image(label='Input', source='upload', type='numpy')
194
+ with gr.Column():
195
+ content_type = gr.Radio(
196
+ label='Content Type',
197
+ choices=[flags.desc_type_photo, flags.desc_type_anime],
198
+ value=flags.desc_type_photo
199
+ )
200
+ desc_btn = gr.Button(value='Describe this Image into Prompt')
201
+ outputs=gr.Textbox(type="text", label="Output", show_copy_button=True)
202
+
203
+ desc_btn.click(interrogatorFunction, inputs=[input_image, content_type], outputs=[outputs])
204
+
205
+ describe.launch()