File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,15 @@ pip install rapid-layout
55
55
56
56
``` python
57
57
import cv2
58
+ from imread_from_url import imread_from_url # pip install imread_from_url
58
59
59
60
from rapid_layout import RapidLayout, VisLayout
60
61
61
62
# model_type类型参见上表。指定不同model_type时,会自动下载相应模型到安装目录下的。
62
63
layout_engine = RapidLayout(model_type = " doclayout_yolo" , conf_thres = 0.2 )
63
64
64
- img_path = " tests/test_files /financial.jpg"
65
- img = cv2.imread(img_path )
65
+ img_url = " https://raw.githubusercontent.com/opendatalab/DocLayout-YOLO/refs/heads/main/assets/example /financial.jpg"
66
+ img = imread_from_url(img_url )
66
67
67
68
boxes, scores, class_names, elapse = layout_engine(img)
68
69
ploted_img = VisLayout.draw_detections(img, boxes, scores, class_names)
You can’t perform that action at this time.
0 commit comments