If you are interesting in an help, please provide details for reproducing problem eg. tesseract version, traineddata source, tesserocr version, OS version, how did you install tesserocr... "RuntimeError: Failed to init API '' indicates problem to start API (use tesseract library), so setting OEM is irrelevant. Also I would suggest to try OCR your image with the tesseract executable to make sure that tesseract is correctly installed and working properly.
Zdenko st 7. 9. 2022 o 15:46 Arnav Mehta <2005arnavmehta2...@gmail.com> napĂsal(a): > Hello, I have the below code > ``` > import io > from PIL import Image > import tesserocr > > with tesserocr.PyTessBaseAPI(path='') as api: > image = Image.open('t1.png') > api.setImage(image) > api.Recognize() > iterator = api.GetIterator() > print(iterator.WordFontAttributes()) > ``` > However, I am getting the error : RuntimeError: Failed to init API > > So, I think the solution is to use --oem = 0, but how do I? > > -- > You received this message because you are subscribed to the Google Groups > "tesseract-ocr" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to tesseract-ocr+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/tesseract-ocr/1717cf00-cc5e-4ed4-bea1-fd780251f03an%40googlegroups.com > <https://groups.google.com/d/msgid/tesseract-ocr/1717cf00-cc5e-4ed4-bea1-fd780251f03an%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/CAJbzG8wsC%2BuU9SOyOYhTw%3DSufjhAPsbVpjDYKG-PjAFyKpuoyg%40mail.gmail.com.