# 使用Claude code生成
```
@demo @mineru 根据@demo/demo.py, 生成流水线执行markdown mermaid流程图,图中需要注明调用的模型以及传递的数据
```
```mermaid
flowchart TD
A[开始] --> B[读取PDF文件]
B --> C{选择后端类型}
C -->|Pipeline| D[PDF转图像]
D --> E[布局检测
DocLayout-YOLO]
E --> F{元素类型}
F -->|文本| G[OCR识别
PyTorch-PaddleOCR]
F -->|公式| H[公式检测
YOLOv8-MFD]
H --> I[公式识别
Unimernet]
F -->|表格| J[表格识别
RapidTable]
F -->|图像| K[图像提取]
G --> L[整合结果]
I --> L
J --> L
K --> L
L --> M[转换为中间JSON]
M --> N[生成输出文件]
C -->|VLM| O[PDF转图像]
O --> P[VLM模型推理
MinerU-VLM]
P --> Q[转换为中间JSON]
Q --> N
N --> R{输出格式}
R -->|Markdown| S[.md文件]
R -->|中间JSON| T[_middle.json]
R -->|模型输出| U[_model.json/.txt]
R -->|内容列表| V[_content_list.json]
R -->|可视化| W[_layout.pdf/_span.pdf]
R -->|原始PDF| X[_origin.pdf]
style D fill:#e1f5fe
style E fill:#f3e5f5
style G fill:#e8f5e8
style H fill:#fff3e0
style I fill:#fff3e0
style J fill:#fce4ec
style K fill:#f1f8e9
style L fill:#f5f5f5
style M fill:#e0f2f1
style O fill:#e1f5fe
style P fill:#f3e5f5
style Q fill:#e0f2f1
classDef model fill:#f5f5f5,stroke:#333,stroke-width:1px;
classDef process fill:#e3f2fd,stroke:#333,stroke-width:1px;
classDef data fill:#e8f5e8,stroke:#333,stroke-width:1px;
classDef output fill:#fce4ec,stroke:#333,stroke-width:1px;
class D,E,G,H,I,J,K,L,M,O,P,Q process
class S,T,U,V,W,X output
```