Spaces:
Sleeping
Sleeping
ZaynZhu
commited on
Commit
Β·
a3ef8aa
1
Parent(s):
af8fa93
optimize layout
Browse files
app.py
CHANGED
|
@@ -56,6 +56,7 @@ RUNS_DIR.mkdir(parents=True, exist_ok=True)
|
|
| 56 |
|
| 57 |
TIMEOUT_SECONDS = 1800 # 30 minutes
|
| 58 |
RETENTION_HOURS = 1 # auto-clean runs older than N hours
|
|
|
|
| 59 |
|
| 60 |
# ---------------------
|
| 61 |
# Utils
|
|
@@ -586,41 +587,61 @@ def run_pipeline(arxiv_url, pdf_file, openai_key, logo_files, meeting_logo_file,
|
|
| 586 |
# =====================
|
| 587 |
# Gradio UI
|
| 588 |
# =====================
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 596 |
label="π·οΈ Institutional Logo (optional, multiple allowed)",
|
| 597 |
file_count="multiple",
|
| 598 |
file_types=["image"],
|
| 599 |
-
)
|
| 600 |
-
|
| 601 |
-
gr.
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
|
| 620 |
-
""
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 624 |
|
| 625 |
if __name__ == "__main__":
|
| 626 |
iface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 56 |
|
| 57 |
TIMEOUT_SECONDS = 1800 # 30 minutes
|
| 58 |
RETENTION_HOURS = 1 # auto-clean runs older than N hours
|
| 59 |
+
DEFAULT_RIGHT_LOGO_PATH = ROOT / "posterbuilder" / "latex_proj" / "logos" / "right_logo.png"
|
| 60 |
|
| 61 |
# ---------------------
|
| 62 |
# Utils
|
|
|
|
| 587 |
# =====================
|
| 588 |
# Gradio UI
|
| 589 |
# =====================
|
| 590 |
+
with gr.Blocks(title="π Paper2Poster") as iface:
|
| 591 |
+
gr.Markdown("# π Paper2Poster")
|
| 592 |
+
gr.Markdown("""
|
| 593 |
+
[Paper](https://arxiv.org/abs/2505.21497) | [GitHub](https://github.com/Paper2Poster/Paper2Poster) | [Project Page](https://paper2poster.github.io/)
|
| 594 |
+
|
| 595 |
+
**TL;DR:** Upload your paper and get an auto-generated poster.
|
| 596 |
+
Please be patient β each paper takes about 8β10 minutes to process.
|
| 597 |
+
|
| 598 |
+
This work, developed in collaboration with [TVG@Oxford](https://torrvision.com/index.html) and [UWaterloo](https://uwaterloo.ca/), has been accepted to [NeurIPS 2025 D&B](https://neurips.cc/).
|
| 599 |
+
The framework builds upon [CAMEL-ai](https://github.com/camel-ai/camel).
|
| 600 |
+
""")
|
| 601 |
+
|
| 602 |
+
# -------- Input box --------
|
| 603 |
+
with gr.Accordion("Input", open=True):
|
| 604 |
+
with gr.Row():
|
| 605 |
+
arxiv_in = gr.Textbox(label="π ArXiv URL (choose one)", placeholder="https://arxiv.org/abs/2505.xxxxx")
|
| 606 |
+
pdf_in = gr.File(label="π Upload PDF (choose one)")
|
| 607 |
+
|
| 608 |
+
key_in = gr.Textbox(label="π OpenAI API Key", placeholder="sk-...", type="password")
|
| 609 |
+
|
| 610 |
+
inst_logo_in = gr.File(
|
| 611 |
label="π·οΈ Institutional Logo (optional, multiple allowed)",
|
| 612 |
file_count="multiple",
|
| 613 |
file_types=["image"],
|
| 614 |
+
)
|
| 615 |
+
|
| 616 |
+
with gr.Row():
|
| 617 |
+
with gr.Column():
|
| 618 |
+
conf_logo_in = gr.File(
|
| 619 |
+
label="π§© Optional: Conference Logo (defaults to NeurIPS logo)",
|
| 620 |
+
file_count="single",
|
| 621 |
+
file_types=["image"],
|
| 622 |
+
)
|
| 623 |
+
with gr.Column():
|
| 624 |
+
conf_preview = gr.Image(
|
| 625 |
+
value=str(DEFAULT_RIGHT_LOGO_PATH) if DEFAULT_RIGHT_LOGO_PATH.exists() else None,
|
| 626 |
+
label="Default conference logo preview",
|
| 627 |
+
interactive=False,
|
| 628 |
+
)
|
| 629 |
+
|
| 630 |
+
theme_in = gr.ColorPicker(label="π¨ Theme Color (optional)", value="#5E2E91")
|
| 631 |
+
|
| 632 |
+
run_btn = gr.Button("π Run", variant="primary")
|
| 633 |
+
|
| 634 |
+
# -------- Output box --------
|
| 635 |
+
with gr.Accordion("Output", open=True):
|
| 636 |
+
logs_out = gr.Textbox(label="π§Ύ Logs (8β10 minutes)", lines=30, max_lines=50)
|
| 637 |
+
zip_out = gr.File(label="π¦ Download Results (.zip)")
|
| 638 |
+
overleaf_out = gr.HTML(label="Open in Overleaf")
|
| 639 |
+
|
| 640 |
+
run_btn.click(
|
| 641 |
+
fn=run_pipeline,
|
| 642 |
+
inputs=[arxiv_in, pdf_in, key_in, inst_logo_in, conf_logo_in, theme_in],
|
| 643 |
+
outputs=[logs_out, zip_out, overleaf_out],
|
| 644 |
+
)
|
| 645 |
|
| 646 |
if __name__ == "__main__":
|
| 647 |
iface.launch(server_name="0.0.0.0", server_port=7860)
|