Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -182,17 +182,24 @@ def interrogatorFunction(img, value):
|
|
182 |
print(output)
|
183 |
return output
|
184 |
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|