EasyOCR 中无法使用 DBnet

问题描述 投票:0回答:1

我正在尝试将 DBnet 模型与 EasyOCR 结合使用,通过使用:

reader = Reader(['ar'], gpu = False,detect_network = 'dbnet18')

EasyOCR 已下载模型,但是,在检测文本时出现以下错误:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[116], line 1
----> 1 easy_ocr(res,r"C:\Users\PC\OCR-App 1\data\interim\iscore\file.txt",r"C:\Users\PC\OCR-App 1\data\interim\iscore\out.jpg")

Cell In[115], line 15, in easy_ocr(image, out_txt, out_image)
     12 ts = time.time()
     13 #min_size=10,width_ths=0.5,add_margin=0.1,paragraph = False,text_threshold =0.15,low_text=0.2
     14 #text_threshold =0.15,low_text=0.2,add_margin=0.09
---> 15 results = reader.readtext(image,paragraph = True)
     16 te = time.time()
     17 td = te - ts

File c:\Users\PC\anaconda3\envs\easyocr\Lib\site-packages\easyocr\easyocr.py:452, in Reader.readtext(self, image, decoder, beamWidth, batch_size, workers, allowlist, blocklist, detail, rotation_info, paragraph, min_size, contrast_ths, adjust_contrast, filter_ths, text_threshold, low_text, link_threshold, canvas_size, mag_ratio, slope_ths, ycenter_ths, height_ths, width_ths, y_ths, x_ths, add_margin, threshold, bbox_min_score, bbox_min_size, max_candidates, output_format)
    446 '''
    447 Parameters:
    448 image: file path or numpy-array or a byte stream object
    449 '''
    450 img, img_cv_grey = reformat_input(image)
--> 452 horizontal_list, free_list = self.detect(img, 
    453                                          min_size = min_size, text_threshold = text_threshold,\
    454                                          low_text = low_text, link_threshold = link_threshold,\
    455                                          canvas_size = canvas_size, mag_ratio = mag_ratio,\
    456                                          slope_ths = slope_ths, ycenter_ths = ycenter_ths,\
    457                                          height_ths = height_ths, width_ths= width_ths,\
...
    231         "Input type is {}, but 'deform_conv_{}.*.so' is not imported successfully.".format(device_, device_),
    232         )
    233 return output

RuntimeError: Input type is cpu, but 'deform_conv_cpu.*.so' is not imported successfully.
python ocr easyocr
1个回答
0
投票

同样的问题你解决了吗?

© www.soinside.com 2019 - 2024. All rights reserved.