shiyutang / Acceleratedcpp

cpp code starter
0 stars 0 forks source link

更换了高精度的检测模型det和识别模型rec以后,cuda会报错: [Hint: 'CUDNN_STATUS_NOT_SUPPORTED'. The functionality requested is not presently supported by cuDNN. ] #6

Open shiyutang opened 10 months ago

shiyutang commented 10 months ago
import os
import cv2
from paddleocr import PPStructure,save_structure_res
from paddleocr.ppstructure.recovery.recovery_to_doc import sorted_layout_boxes, convert_info_docx

det_model_dir='./inference/detv4_teacher_inference'
rec_model_dir='./inference/ch_PP-OCRv4_rec_server_infer'

table_engine = PPStructure(recovery=True,det_model_dir=det_model_dir,rec_model_dir=rec_model_dir)

save_folder = './output/huifu'
img_path = '微信截图_20230810150058.png'
img = cv2.imread(img_path)
result = table_engine(img)
save_structure_res(result, save_folder, os.path.basename(img_path).split('.')[0])

for line in result:
    line.pop('img')
    print(line)

h, w, _ = img.shape
res = sorted_layout_boxes(result, w)
convert_info_docx(img, res, save_folder, os.path.basename(img_path).split('.')[0])

我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no): yes

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

THE-FLIER commented 10 months ago

一样问题,求解答