Layout-Parser / layout-parser

A Unified Toolkit for Deep Learning Based Document Image Analysis
https://layout-parser.github.io/
Apache License 2.0
4.75k stars 456 forks source link

Unable to access OCR feature #93

Closed ayush2709 closed 2 years ago

ayush2709 commented 2 years ago

Hi Team, I have been trying to use layout-parser for my project. But I constantly get this issue - AttributeError: module layoutparser has no attribute ocr

I have installed the OCR module via command pip install layoutparser[ocr]

The code that throws this error is - ocr_agent = lp.ocr.TesseractAgent(languages='eng')

Need help here. Thanks!

lolipopshock commented 2 years ago

Could you try with the following?

  1. pip install -U layoutparser[ocr] (adding -U for upgrading)
  2. lp.TesseractAgent(languages='eng') (removing .ocr)
ayush2709 commented 2 years ago

Hey @lolipopshock , Thank you for your reply.

The second option worked for me.