Spaces:
Running
on
Zero
Running
on
Zero
Update feifeiui/feifeiui.py
Browse files- feifeiui/feifeiui.py +12 -1
feifeiui/feifeiui.py
CHANGED
@@ -6,6 +6,7 @@ from feifeilib.feifeichat import feifeichat
|
|
6 |
from feifeilib.feifeitexttoimg import feifeitexttoimg
|
7 |
from feifeilib.feifeiflorence import feifeiflorence
|
8 |
from feifeilib.feifeifluxapi import feifeifluxapi
|
|
|
9 |
|
10 |
MAX_SEED = np.iinfo(np.int32).max
|
11 |
MAX_IMAGE_SIZE = 2048
|
@@ -129,7 +130,15 @@ def create_ui():
|
|
129 |
output_text = gr.Textbox(label="Output Text",
|
130 |
show_label=False,
|
131 |
container=False)
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
with gr.Column(scale=1, elem_id="col-container"):
|
134 |
gr.ChatInterface(
|
135 |
feifeichat,
|
@@ -181,4 +190,6 @@ def create_ui():
|
|
181 |
inputs=[input_img], # Input components for the function
|
182 |
outputs=[output_text], # Output component for the function
|
183 |
)
|
|
|
|
|
184 |
return FeiFei
|
|
|
6 |
from feifeilib.feifeitexttoimg import feifeitexttoimg
|
7 |
from feifeilib.feifeiflorence import feifeiflorence
|
8 |
from feifeilib.feifeifluxapi import feifeifluxapi
|
9 |
+
from feifeilib.feifeiflorencebase import process_image
|
10 |
|
11 |
MAX_SEED = np.iinfo(np.int32).max
|
12 |
MAX_IMAGE_SIZE = 2048
|
|
|
130 |
output_text = gr.Textbox(label="Output Text",
|
131 |
show_label=False,
|
132 |
container=False)
|
133 |
+
|
134 |
+
with gr.Tab(label="Florence-2"):
|
135 |
+
with gr.Row():
|
136 |
+
florence_input_img = gr.Image(label="Input Picture",height=320)
|
137 |
+
with gr.Row():
|
138 |
+
florence_submit_btn = gr.Button(value="Submit")
|
139 |
+
with gr.Row():
|
140 |
+
florence_output_text = gr.Textbox(label="Output Text")
|
141 |
+
|
142 |
with gr.Column(scale=1, elem_id="col-container"):
|
143 |
gr.ChatInterface(
|
144 |
feifeichat,
|
|
|
190 |
inputs=[input_img], # Input components for the function
|
191 |
outputs=[output_text], # Output component for the function
|
192 |
)
|
193 |
+
|
194 |
+
florence_submit_btn.click(process_image, [florence_input_img], [florence_output_text])
|
195 |
return FeiFei
|