Update main.py
Browse files
main.py
CHANGED
|
@@ -21,6 +21,12 @@ app = Flask(__name__)
|
|
| 21 |
|
| 22 |
MAX_LENGTH = 38
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
def format_tesseract_output(output_text):
|
| 25 |
formatted_text = ""
|
| 26 |
lines = output_text.strip().split("\n")
|
|
|
|
| 21 |
|
| 22 |
MAX_LENGTH = 38
|
| 23 |
|
| 24 |
+
# Set the TESSDATA_PREFIX environment variable
|
| 25 |
+
os.environ['TESSDATA_PREFIX'] = '/usr/share/tesseract-ocr/4.00/tessdata'
|
| 26 |
+
|
| 27 |
+
# Set the path to the Tesseract executable
|
| 28 |
+
pytesseract.pytesseract.tesseract_cmd = r'/usr/bin/tesseract'
|
| 29 |
+
|
| 30 |
def format_tesseract_output(output_text):
|
| 31 |
formatted_text = ""
|
| 32 |
lines = output_text.strip().split("\n")
|