Spaces:
Sleeping
Sleeping
AI Agent commited on
Commit ·
e66cd5c
1
Parent(s): 620247d
Fix Gradio 6.0 API: move theme/css to launch(), remove unsupported show_download_button
Browse files
app.py
CHANGED
|
@@ -309,12 +309,14 @@ custom_css = """
|
|
| 309 |
}
|
| 310 |
"""
|
| 311 |
|
| 312 |
-
|
| 313 |
primary_hue="orange",
|
| 314 |
secondary_hue="blue",
|
| 315 |
neutral_hue="slate",
|
| 316 |
font=gr.themes.GoogleFont("Inter"),
|
| 317 |
-
)
|
|
|
|
|
|
|
| 318 |
gr.Markdown("# SAM 3 Concept Asset Extractor", elem_id="app-title")
|
| 319 |
gr.Markdown(
|
| 320 |
"Upload a presentation slide to automatically extract all distinct elements "
|
|
@@ -349,8 +351,6 @@ with gr.Blocks(title="SAM 3 Asset Extractor", css=custom_css, theme=gr.themes.So
|
|
| 349 |
columns=3,
|
| 350 |
object_fit="contain",
|
| 351 |
height=650,
|
| 352 |
-
show_download_button=True,
|
| 353 |
-
show_share_button=False,
|
| 354 |
elem_classes=["gallery-container"],
|
| 355 |
preview=True,
|
| 356 |
)
|
|
@@ -358,4 +358,4 @@ with gr.Blocks(title="SAM 3 Asset Extractor", css=custom_css, theme=gr.themes.So
|
|
| 358 |
submit_btn.click(fn=extract_assets, inputs=[input_image], outputs=[output_gallery])
|
| 359 |
|
| 360 |
if __name__ == "__main__":
|
| 361 |
-
demo.launch()
|
|
|
|
| 309 |
}
|
| 310 |
"""
|
| 311 |
|
| 312 |
+
app_theme = gr.themes.Soft(
|
| 313 |
primary_hue="orange",
|
| 314 |
secondary_hue="blue",
|
| 315 |
neutral_hue="slate",
|
| 316 |
font=gr.themes.GoogleFont("Inter"),
|
| 317 |
+
)
|
| 318 |
+
|
| 319 |
+
with gr.Blocks(title="SAM 3 Asset Extractor") as demo:
|
| 320 |
gr.Markdown("# SAM 3 Concept Asset Extractor", elem_id="app-title")
|
| 321 |
gr.Markdown(
|
| 322 |
"Upload a presentation slide to automatically extract all distinct elements "
|
|
|
|
| 351 |
columns=3,
|
| 352 |
object_fit="contain",
|
| 353 |
height=650,
|
|
|
|
|
|
|
| 354 |
elem_classes=["gallery-container"],
|
| 355 |
preview=True,
|
| 356 |
)
|
|
|
|
| 358 |
submit_btn.click(fn=extract_assets, inputs=[input_image], outputs=[output_gallery])
|
| 359 |
|
| 360 |
if __name__ == "__main__":
|
| 361 |
+
demo.launch(css=custom_css, theme=app_theme)
|