Win10 下安裝使用easyocr圖片識別工具


[前言]

  最近在做圖像識別相關的工作,找到了一個名為EasyOCR的pythoh 庫。

  使用過程中出現了一些問題,現做簡單記錄。

[正文]

  1. 安裝EasyOCR

    我用了最簡單的方法:pip3 install easyocr

  2.測試:

1 import easyocr
2 
3 # 創建reader對象
4 reader = easyocr.Reader(['ch_sim', 'en'], gpu=False)
5 # 讀取圖像
6 result = reader.readtext("./image/1.jpg")
7 
8 print(result)

  識別圖片過程中有兩個問題:

    (1). 提示Pillow庫版本過低(低於7.0),於是我用pip3 uninstall Pillow卸載了原Pillow庫:

      i.  pip3 install Pillow=7.0后發現報錯(版本相關),

      ii.  然后直接pip3 install Pillow 默認安裝了一個8版本的,問題解決;

    (2). 一直顯示"Downloading detection model, please wait",找到其下載庫的URL,發現訪問有問題。

      后來根據作者在github上的提示,直接將庫下載解壓到了~/.EasyOCR/model/目錄下

      (這是easyocr默認模型目錄,即C:\Users\你的用戶名\.EasyOCR\model)

      注意,下載好的模型包是.zip的,需要解壓出來(.pth)才可以被識別;

      模型地址:

      text detection model (CRAFT)

      latin modelchinese (traditional) model 

      chinese (simplified) model 

      japanese model 

      korean model 

      thai model 

      devanagari model 

      cyrillic model 

      arabic model 

      tamil model 

      bengali model 

      telugu model 

      kannada model

[參考]

    EasyOCR github:https://github.com/JaidedAI/EasyOCR


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM