Skip to content

Commit ca33b3e

Browse files
committed
docs: update README
1 parent a7ab63f commit ca33b3e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,27 @@ print(results)
118118
results.vis("layout_res.png")
119119
```
120120

121+
### NPU使用
122+
123+
详细配置参数参见:[link](https://github.com/RapidAI/RapidLayout/blob/a7ab63ff291bd72e1a98ac2bb11860575514f432/rapid_layout/configs/engine_cfg.yaml)
124+
125+
```python
126+
from rapid_layout import EngineType, ModelType, RapidLayout, RapidLayoutInput
127+
128+
cfg = RapidLayoutInput(
129+
model_type=ModelType.PP_LAYOUT_CDLA,
130+
engine_type=EngineType.ONNXRUNTIME,
131+
engine_cfg={"use_cann": True, "cann_ep_cfg.gpu_id": 0},
132+
)
133+
layout_engine = RapidLayout(cfg=cfg)
134+
135+
img_path = "https://raw.githubusercontent.com/opendatalab/DocLayout-YOLO/refs/heads/main/assets/example/financial.jpg"
136+
results = layout_engine(img_path)
137+
print(results)
138+
139+
results.vis("layout_res.png")
140+
```
141+
121142
### 参考项目
122143

123144
- [DocLayout-YOLO](https://github.com/opendatalab/DocLayout-YOLO)

0 commit comments

Comments
 (0)