Skill: caoxinran102-sys/newpaper-skill (version 1.0.0)

--- name: paper2poster description: 将学术论文 PDF 自动转换为 PowerPoint 海报（PPTX）和 HTML 文件。支持 UniAPI、MiniMax 等 OpenAI 兼容 API。 --- # Paper2Poster 学术海报生成器 ## 技能说明 技能将从 GitHub 仓库获取代码。用户只需提供论文 PDF 和自己的 API Key，AI 将自动完成环境检查、依赖安装、配置和海报生成。 ## 触发条件 用户说："帮我生成海报"、"把这篇论文转成海报"、"生成学术海报"并提供论文 PDF 路径。 ## 执行步骤 当用户触发此技能时，请严格按以下顺序自动执行： ### 第一步：克隆项目仓库 检查当前目录是否存在 `PosterAgent/` 文件夹，如果不存在，则执行： ```bash git clone https://github.com/caoxinran102-sys/Paper2Poster.git . ``` > **注意**：命令末尾的 `.` 表示克隆到当前目录，不要创建额外的子文件夹。 ### 第二步：验证项目目录 克隆完成后，确保当前目录即为项目根目录（包含 `PosterAgent/` 文件夹）： ```bash if [ ! -d "PosterAgent" ]; then echo "错误：未找到 PosterAgent 目录，克隆可能失败" exit 1 fi ``` ### 第三步：检查 Python 环境 ```bash if ! command -v conda &> /dev/null; then echo "⚠️ Conda 未安装，请先安装 Miniconda" exit 1 fi conda env list | grep -q poster_env || conda create -n poster_env python=3.10 -y eval "$(conda shell.bash hook)" conda activate poster_env ``` ### 第四步：安装依赖 ```bash pip install --upgrade pip pip install -r requirements.txt ``` 如果遇到 docling-parse 相关错误（ModuleNotFoundError），执行降级： ```bash pip uninstall docling-parse docling -y pip install docling-parse==2.1.0 docling==2.6.0 ``` ### 第五步：配置 API 密钥 检查当前目录下是否有 .env 文件。如果没有，询问用户提供： - `OPENAI_API_KEY`（例如 UniAPI 的 sk-xxx 或 MiniMax 的 sk-xxx） - `OPENAI_BASE_URL`（例如 https://hk.uniapi.io/v1 或 https://api.minimaxi.com/v1） 创建 .env 文件并写入： ```bash cat > .env << EOF OPENAI_API_KEY=用户提供的值 OPENAI_BASE_URL=用户提供的值 WORKSPACE_DIR=${WORKSPACE_DIR:-./workspace} EOF ``` ### 第六步：准备论文文件 - 要求用户提供论文 PDF 的完整路径（例如 `/home/user/paper.pdf`） - 如果用户有机构 Logo，也要求提供路径（可选） - 无需创建特定目录，直接使用用户提供的路径。 ### 第七步：运行海报生成 执行以下命令（替换 `{论文路径}` 和 `{Logo路径}`）： ```bash python -m PosterAgent.new_pipeline \ --poster_path="{论文路径}" \ --model_name_t="claude-sonnet-4-20250514" \ --model_name_v="claude-sonnet-4-20250514" \ --institution_logo_path="{Logo路径}" \ --max_workers=1 ``` > **提示**：如果用户没有 Logo，省略 `--institution_logo_path` 参数。 ### 第八步：异常处理与重试 | 错误类型 | 处理策略 | 重试行为 | |---------|---------|---------| | 429 或 529 错误 | 速率限制，等待后重试 | 延迟加倍（初始 60 秒） | | 400 格式错误 | 切换备用模型后重试 | 立即重试 | | 超时错误 | 等待后重试 | 延迟 30 秒 | **重试逻辑示例**（AI 应自行实现）： 1. 设置最大重试次数为 **3** 2. 初始延迟设为 **60 秒** 3. 每次重试失败后，延迟时间 **加倍** 4. 如果返回 429 或 529，按上述延迟策略重试 5. 如果返回 400 格式错误，切换备用模型后立即重试 6. 如果超时，等待 30 秒后重试 --- ## 输出结果 ✅ **海报生成完成！** 📁 **输出文件位置**： - PPTX: `./generated_posters/.../xxx.pptx` - HTML: `./generated_posters/.../xxx.html` 📋 **处理摘要**： - 论文: {文件名} - 状态: 成功

path: README.md
content: # 🎓Paper2Poster: Multimodal Poster Automation from Scientific Papers
# 从学术论文自动生成学术海报

<p align="center">
  <a href="https://arxiv.org/abs/2505.21497" target="_blank"><img src="https://img.shields.io/badge/arXiv-2505.21497-red"></a>
  <a href="https://paper2poster.github.io/" target="_blank"><img src="https://img.shields.io/badge/Project-Page-brightgreen"></a>
  <a href="https://huggingface.co/datasets/Paper2Poster/Paper2Poster" target="_blank"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Dataset-orange"></a>
  <a href="https://huggingface.co/papers/2505.21497" target="_blank"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Daily Papers-red"></a>
  <a href="https://x.com/_akhaliq/status/1927721150584390129" target="_blank"><img alt="X (formerly Twitter) URL" src="https://img.shields.io/twitter/url?url=https%3A%2F%2Fx.com%2F_akhaliq%2Fstatus%2F1927721150584390129"></a>
  <a href="https://huggingface.co/spaces/camel-ai/Paper2Poster" target="_blank"> <img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces%20Demo-blue"> </a>
</p>

We address **How to create a poster from a paper** and **How to evaluate poster.**

![Overview](./assets/overall.png)


## 🤩 Paper2Poster for Paper2Poster

![Overview](./assets/teaser.jpeg)

## 🔥 Update
- [x] [2025.11.3] Added **Gradio demo** support.
- [x] [2025.10.18] Added **Docker** support.
- [x] [2025.10.13] Added automatic **logo support** for conferences and institutions, **YAML-based style customization**, a new default theme.
- [x] [2025.9.18] Paper2Poster has been accepted to **NeurIPS 2025 Dataset and Benchmark Track**.
- [x] [2025.9.3]  We now support generate per section content in **parallel** for faster generation, by simply specifying `--max_workers`.
- [x] [2025.5.27] We release the [arXiv](https://arxiv.org/abs/2505.21497), [code](https://github.com/Paper2Poster/Paper2Poster) and [`dataset`](https://huggingface.co/datasets/Paper2Poster/Paper2Poster)

<!--## 📚 Introduction-->

**PosterAgent** is a top-down, visual-in-the-loop multi-agent system from `paper.pdf` to **editable** `poster.pptx`.

![PosterAgent Overview](./assets/posteragent.png)

<!--A Top-down, visual-in-the-loop, efficient multi-agent pipeline, which includes (a) Parser distills the paper into a structured asset library; the (b) Planner aligns text–visual pairs into a binary‐tree layout that preserves reading order and spatial balance; and the (c) Painter-Commentor loop refines each panel by executing rendering code and using VLM feedback to eliminate overflow and ensure alignment.-->

<!--![Paper2Poster Overview](./assets/paperquiz.png)-->

<!--**Paper2Poster:** A benchmark for paper to poster generation, paired with human generated poster, with a comprehensive evaluation suite, including metrics like **Visual Quality**, **Textual Coherence**, **VLM-as-Judge** and **PaperQuiz**. Notably, PaperQuiz is a novel evaluation which assume A Good poster should convey core paper content visually.-->

## 📋 Table of Contents

<!--- [📚 Introduction](#-introduction)-->
- [🛠️ Installation](#-installation)
- [🐳 Docker Deployment](#-docker-deployment)
- [🚀 Quick Start](#-quick-start)
- [🔮 Evaluation](#-evaluation)
---

## 🛠️ Installation
Our Paper2Poster supports both local deployment (via [vLLM](https://docs.vllm.ai/en/v0.6.6/getting_started/installation.html)) or API-based access (e.g., GPT-4o).

**Python Environment**
```bash
pip install -r requirements.txt
```

**Install Libreoffice**
```bash
sudo apt install libreoffice
```

or, if you do **not** have sudo access, download `soffice` executable directly: https://www.libreoffice.org/download/download-libreoffice/, and add the executable directory to your `$PATH`.

**Install poppler**
```bash
conda install -c conda-forge poppler
```

**API Key**

Create a `.env` file in the project root and add your OpenAI API key:

```bash
OPENAI_API_KEY=<your_openai_api_key>
```

**Optional: Google Search API (for logo search)**

To use Google Custom Search for more reliable logo search, add these to your `.env` file:

```bash
GOOGLE_SEARCH_API_KEY=<your_google_search_api_key>
GOOGLE_SEARCH_ENGINE_ID=<your_search_engine_id>
```

---

## 🐳 Docker Deployment

For easier deployment, you can use Docker to run Paper2Poster without manual dependency installation.

**Build the Docker image:**
```bash
docker build -t paper2poster .
```

**Troubleshooting:**
- If you get a "permission denied" error when running Docker commands, use `sudo` before Docker commands (e.g., `sudo docker build -t paper2poster .`)

**Example:**
```bash
# Create output directory if it doesn't exist
mkdir -p <4o_4o>_generated_posters

docker run --rm \
-e OPENAI_API_KEY=<your_openai_api_key> \
-v "$(pwd)/Paper2Poster-data:/Paper2Poster-data" \
-v "$(pwd)/<4o_4o>_generated_posters:/app/<4o_4o>_generated_posters" \
paper2poster \
python -m PosterAgent.new_pipeline \
--poster_path="/Paper2Poster-data/<paper_name>/paper.pdf" \
--model_name_t=4o \
--model_name_v=4o \
--poster_width_inches=48 \
--poster_height_inches=36
```

The generated poster will be saved in `<4o_4o>_generated_posters/Paper2Poster-data/paper_name/poster.pptx` on your host machine.

---

## 🚀 Quick Start
Create a folder named `{paper_name}` under `{dataset_dir}`, and place your paper inside it as a PDF file named `paper.pdf`.
```
📁 {dataset_dir}/
└── 📁 {paper_name}/
    └── 📄 paper.pdf
```
To use open-source models, you need to first deploy them using [vLLM](https://docs.vllm.ai/en/v0.6.6/getting_started/installation.html), ensuring the port is correctly specified in the `get_agent_config()` function in [`utils/wei_utils.py`](utils/wei_utils.py).

- [High Performance] Generate a poster with `GPT-4o`:

```bash
python -m PosterAgent.new_pipeline \
    --poster_path="${dataset_dir}/${paper_name}/paper.pdf" \
    --model_name_t="4o" \  # LLM
    --model_name_v="4o" \  # VLM
    --poster_width_inches=48 \
    --poster_height_inches=36
```

- [Economic] Generate a poster with `Qwen-2.5-7B-Instruct` and `GPT-4o`:

```bash
python -m PosterAgent.new_pipeline \
    --poster_path="${dataset_dir}/${paper_name}/paper.pdf" \
    --model_name_t="vllm_qwen" \  # LLM
    --model_name_v="4o" \         # VLM
    --poster_width_inches=48 \
    --poster_height_inches=36 \
    --no_blank_detection          # An option to disable blank detection
```

- [Local] Generate a poster with `Qwen-2.5-7B-Instruct`:

```bash
python -m PosterAgent.new_pipeline \
    --poster_path="${dataset_dir}/${paper_name}/paper.pdf" \
    --model_name_t="vllm_qwen" \           # LLM
    --model_name_v="vllm_qwen_vl" \        # VLM
    --poster_width_inches=48 \
    --poster_height_inches=36
```

PosterAgent **supports flexible combination of LLM / VLM**, feel free to try other options, or customize your own settings in `get_agent_config()` in [`utils/wei_utils.py`](utils/wei_utils.py).

### Adding Logos to Posters

You can automatically add institutional and conference logos to your posters:

```bash
python -m PosterAgent.new_pipeline \
    --poster_path="${dataset_dir}/${paper_name}/paper.pdf" \
    --model_name_t="4o" \
    --model_name_v="4o" \
    --poster_width_inches=48 \
    --poster_height_inches=36 \
    --conference_venue="NeurIPS"  # Automatically searches for conference logo
```

**Logo Search Strategy:**
1. **Local search**: First checks the provided logo store (`logo_store/institutes/` and `logo_store/conferences/`)
2. **Web search**: If not found locally, performs online search
   - By default, uses DuckDuckGo (no API key required)
   - For more reliable results, use `--use_google_search` (requires `GOOGLE_SEARCH_API_KEY` and `GOOGLE_SEARCH_ENGINE_ID` in `.env`)

You can also specify custom logo paths to skip auto-detection:
```bash
--institution_logo_path="path/to/institution_logo.png" \
--conference_logo_path="path/to/conference_logo.png"
```

### YAML Style Customization

Customize poster appearance via YAML configuration files:
- **Global defaults**: `config/poster.yaml` (applies to all posters)
- **Per-poster override**: Place `poster.yaml` next to your `paper.pdf` for custom styling


## 🔮 Evaluation
Download Paper2Poster evaluation dataset via:
```bash
python -m PosterAgent.create_dataset
```

In evaluation, papers are stored under a directory called `Paper2Poster-data`.

To evaluate a generated poster with **PaperQuiz**:
```bash
python -m Paper2Poster-eval.eval_poster_pipeline \
    --paper_name="${paper_name}" \
    --poster_method="${model_t}_${model_v}_generated_posters" \
    --metric=qa # PaperQuiz
```

To evaluate a generated poster with **VLM-as-Judge**:
```bash
python -m Paper2Poster-eval.eval_poster_pipeline \
    --paper_name="${paper_name}" \
    --poster_method="${model_t}_${model_v}_generated_posters" \
    --metric=judge # VLM-as-Judge
```

To evaluate a generated poster with other statistical metrics (such as visual similarity, PPL, etc):
```bash
python -m Paper2Poster-eval.eval_poster_pipeline \
    --paper_name="${paper_name}" \
    --poster_method="${model_t}_${model_v}_generated_posters" \
    --metric=stats # statistical measures
```

If you want to create a PaperQuiz for your own paper:
```bash
python -m Paper2Poster-eval.create_paper_questions \
    --paper_folder="Paper2Poster-data/${paper_name}"
```

## ❤ Acknowledgement
We extend our gratitude to [🐫CAMEL](https://github.com/camel-ai/camel), [🦉OWL](https://github.com/camel-ai/owl), [Docling](https://github.com/docling-project/docling), [PPTAgent](https://github.com/icip-cas/PPTAgent) for providing their codebases.

## 📖 Citation

Please kindly cite our paper if you find this project helpful.

```bibtex
@misc{paper2poster,
      title={Paper2Poster: Towards Multimodal Poster Automation from Scientific Papers}, 
      author={Wei Pang and Kevin Qinghong Lin and Xiangru Jian and Xi He and Philip Torr},
      year={2025},
      eprint={2505.21497},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2505.21497}, 
}
```


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (HIGH)