Reputation: 1
Working on an AI project which involves tesseract, a deep learning optical character recognition tool for python. You generally run it from the command line. The command "cd C:\Users\Ricky\Desktop & tesseract assent.png out.txt" works when it's done from the command line but does not work when done from PyCharm via os.system. In the command, assent.png is the file that tesseract is reading (it's a picture of the word "assent") and out.txt is the file which holds the text that tesseract predicts (so it should be a txt file with the word "assent" in it). I've tried a number of different fixes but none have worked. Specifying full paths, running as administrator, changing into different directories like C:\Program Files\Tesseract-OCR, etc, and nothing has worked. I can, however, run a command like "echo hello > hello.txt" in PyCharm and it works just fine. Not sure why os.system is being so stubborn. The error I get is "'tesseract' is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified." Here's the link to the article. Just trying to get the code working: https://medium.com/@sharon.qian.10/adversarial-robustness-of-optical-character-recognition-ocr-91eedc36ef6 Thanks in advance.
Upvotes: 0
Views: 138