ZaynZhu commited on
Commit
a3ef8aa
Β·
1 Parent(s): af8fa93

optimize layout

Browse files
Files changed (1) hide show
  1. app.py +53 -32
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
- iface = gr.Interface(
590
- fn=run_pipeline,
591
- inputs=[
592
- gr.Textbox(label="πŸ“˜ ArXiv URL (choose one)", placeholder="https://arxiv.org/abs/2505.xxxxx"),
593
- gr.File(label="πŸ“„ Upload PDF (choose one)"),
594
- gr.Textbox(label="πŸ”‘ OpenAI API Key", placeholder="sk-...", type="password"),
595
- gr.File(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
596
  label="🏷️ Institutional Logo (optional, multiple allowed)",
597
  file_count="multiple",
598
  file_types=["image"],
599
- ),
600
- gr.File(label="🧩 Optional: Conference Logo (defaults to NeurIPS logo)", file_count="single", file_types=["image"]),
601
- gr.ColorPicker(
602
- label="🎨 Theme Color (optional)",
603
- value="#5E2E91" # default purple (94,46,145)
604
- ),
605
- ],
606
- outputs=[
607
- gr.Textbox(label="🧾 Logs (8~10 minutes)", lines=30, max_lines=50),
608
- gr.File(label="πŸ“¦ Download Results (.zip)"),
609
- gr.HTML(label="Open in Overleaf")
610
- ],
611
-
612
- title="πŸŽ“ Paper2Poster",
613
- description="""
614
- [paper](https://arxiv.org/abs/2505.21497) | [GitHub](https://github.com/Paper2Poster/Paper2Poster) | [project page](https://paper2poster.github.io/)
615
-
616
- Upload a paper, generate a poster for you.
617
- Each paper takes approximately **8–10 minutes**.
618
-
619
- This work is based on the **[CAMEL-ai](https://camel-ai.org/)** framework.
620
- """,
621
-
622
- allow_flagging="never",
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)