File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,27 @@ print(results)
118118results.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 )
You can’t perform that action at this time.
0 commit comments