Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -164,20 +164,6 @@ def get_caption(img,model_name):
|
|
| 164 |
return generated_text_prefix[:-1] if generated_text_prefix[-1] == "." else generated_text_prefix #remove period at end if present
|
| 165 |
|
| 166 |
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
# get_images = gr.load("ryaalbr/ImageSearch", src="spaces", hf_token=environ["api_key"])
|
| 182 |
# def search_images(text):
|
| 183 |
# return get_images(text, api_name="images")
|
|
@@ -235,8 +221,6 @@ def search(search_query):
|
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
-
|
| 239 |
-
|
| 240 |
with gr.Blocks() as demo:
|
| 241 |
|
| 242 |
with gr.Tab("Classification"):
|
|
@@ -279,7 +263,7 @@ with gr.Blocks() as demo:
|
|
| 279 |
gr.Markdown(instructions)
|
| 280 |
with gr.Row():
|
| 281 |
with gr.Column(variant="panel"):
|
| 282 |
-
im_cap = gr.Image(interactive=False
|
| 283 |
model_name = gr.Radio(choices=["COCO","Conceptual captions"], type="value", value="COCO", label="Model").style(container=True, item_container = False)
|
| 284 |
with gr.Row():
|
| 285 |
get_btn_cap = gr.Button("Get Random Image").style(full_width=False)
|
|
@@ -298,7 +282,7 @@ with gr.Blocks() as demo:
|
|
| 298 |
with gr.Column(variant="panel"):
|
| 299 |
desc = gr.Textbox(show_label=False, placeholder="Enter description").style(container=False)
|
| 300 |
gr.Examples(["someone holding flowers",
|
| 301 |
-
"someone holding
|
| 302 |
"red fruit in a person's hands",
|
| 303 |
"an aerial view of forest",
|
| 304 |
"a waterfall with a rainbow"
|
|
|
|
| 164 |
return generated_text_prefix[:-1] if generated_text_prefix[-1] == "." else generated_text_prefix #remove period at end if present
|
| 165 |
|
| 166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
# get_images = gr.load("ryaalbr/ImageSearch", src="spaces", hf_token=environ["api_key"])
|
| 168 |
# def search_images(text):
|
| 169 |
# return get_images(text, api_name="images")
|
|
|
|
| 221 |
|
| 222 |
|
| 223 |
|
|
|
|
|
|
|
| 224 |
with gr.Blocks() as demo:
|
| 225 |
|
| 226 |
with gr.Tab("Classification"):
|
|
|
|
| 263 |
gr.Markdown(instructions)
|
| 264 |
with gr.Row():
|
| 265 |
with gr.Column(variant="panel"):
|
| 266 |
+
im_cap = gr.Image(interactive=False).style(height=height)
|
| 267 |
model_name = gr.Radio(choices=["COCO","Conceptual captions"], type="value", value="COCO", label="Model").style(container=True, item_container = False)
|
| 268 |
with gr.Row():
|
| 269 |
get_btn_cap = gr.Button("Get Random Image").style(full_width=False)
|
|
|
|
| 282 |
with gr.Column(variant="panel"):
|
| 283 |
desc = gr.Textbox(show_label=False, placeholder="Enter description").style(container=False)
|
| 284 |
gr.Examples(["someone holding flowers",
|
| 285 |
+
"someone holding pink flowers",
|
| 286 |
"red fruit in a person's hands",
|
| 287 |
"an aerial view of forest",
|
| 288 |
"a waterfall with a rainbow"
|