rapid_layout运行出现的问题 #27
-
|
请提供下述完整信息以便快速定位问题 lib\site-packages\rapid_layout\utils\vis_res.py", line 35, in draw_detections
det_img = image.copy()
AttributeError: 'str' object has no attribute 'copy'
import cv2
from rapid_layout import RapidLayout, VisLayout
layout_engine = RapidLayout(model_type="doclayout_docstructbench")
img="s:/temp/demo.jpg"
boxes, scores, class_names, elapse = layout_engine(img)
ploted_img = VisLayout.draw_detections(img, boxes, scores, class_names)
if ploted_img is not None:
cv2.imwrite("layout_res.png", ploted_img)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
这里传入的img是 |
Beta Was this translation helpful? Give feedback.
-
|
layout_engine = RapidLayout(conf_thres=0.5, model_path=r'layout_table.onnx') layout_engine = RapidLayout(conf_thres=0.5, model_path=r'doclayout_yolo_docstructbench_imgsz1024.onnx')老代码,用新模型报错, boxes, scores, class_names, elapse = layout_engine(img) Process finished with exit code 1 |
Beta Was this translation helpful? Give feedback.
这里传入的img是
np.ndarray格式的