hong-xl
commited on
Commit
β’
73ff91d
1
Parent(s):
42d3cd3
update application file
Browse files
app.py
CHANGED
@@ -20,10 +20,10 @@ def create_html_page(input_image):
|
|
20 |
text = 'model output text'
|
21 |
draw.text((0, image.height), text, fill=color)
|
22 |
# ε°εΈ¦ζεΎηεζζ¬η HTML ι‘΅ι’θΏε
|
23 |
-
output_html = '<img src="data:image/png;base64,{}">'.format(
|
24 |
-
|
25 |
-
output_html += '<p>{}</p>'.format(text)
|
26 |
-
return
|
27 |
|
28 |
# Create Gradio input and output components
|
29 |
image_input = gr.inputs.Image(type='filepath', label="Input Image")
|
@@ -36,6 +36,6 @@ semantic_segment_device = gr.inputs.Radio(choices=['cuda', 'cpu'], default='cuda
|
|
36 |
controlnet_device = gr.inputs.Radio(choices=['cuda', 'cpu'], default='cpu', label='ControlNet Device')
|
37 |
|
38 |
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
39 |
-
iface = gr.Interface(fn=create_html_page, inputs=[image_input], outputs=["
|
40 |
|
41 |
iface.launch()
|
|
|
20 |
text = 'model output text'
|
21 |
draw.text((0, image.height), text, fill=color)
|
22 |
# ε°εΈ¦ζεΎηεζζ¬η HTML ι‘΅ι’θΏε
|
23 |
+
# output_html = '<img src="data:image/png;base64,{}">'.format(
|
24 |
+
# draw.getvalue().encode('base64').decode())
|
25 |
+
# output_html += '<p>{}</p>'.format(text)
|
26 |
+
return draw
|
27 |
|
28 |
# Create Gradio input and output components
|
29 |
image_input = gr.inputs.Image(type='filepath', label="Input Image")
|
|
|
36 |
controlnet_device = gr.inputs.Radio(choices=['cuda', 'cpu'], default='cpu', label='ControlNet Device')
|
37 |
|
38 |
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
39 |
+
iface = gr.Interface(fn=create_html_page, inputs=[image_input], outputs=["image"])
|
40 |
|
41 |
iface.launch()
|