Update main.py
Browse files
main.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
import io
|
2 |
-
import os
|
3 |
from flask import Flask, request, jsonify
|
4 |
import base64
|
5 |
import pytesseract
|
@@ -10,20 +9,10 @@ from keras.applications.xception import Xception # to get pre-trained model Xcep
|
|
10 |
from keras.models import load_model
|
11 |
from keras.preprocessing.sequence import pad_sequences
|
12 |
|
13 |
-
print(os.popen(f'cat /etc/debian_version').read())
|
14 |
-
print(os.popen(f'cat /etc/issue').read())
|
15 |
-
print(os.popen(f'apt search tesseract').read())
|
16 |
-
|
17 |
app = Flask(__name__)
|
18 |
|
19 |
MAX_LENGTH = 38
|
20 |
|
21 |
-
# Set the TESSDATA_PREFIX environment variable
|
22 |
-
# os.environ['TESSDATA_PREFIX'] = '/cache/huggingface/downloads/tesseract-ocr/4.00/tessdata'
|
23 |
-
|
24 |
-
# Set the path to the Tesseract executable
|
25 |
-
# pytesseract.pytesseract.tesseract_cmd = r'/usr/bin/tesseract'
|
26 |
-
|
27 |
def format_tesseract_output(output_text):
|
28 |
formatted_text = ""
|
29 |
lines = output_text.strip().split("\n")
|
|
|
1 |
import io
|
|
|
2 |
from flask import Flask, request, jsonify
|
3 |
import base64
|
4 |
import pytesseract
|
|
|
9 |
from keras.models import load_model
|
10 |
from keras.preprocessing.sequence import pad_sequences
|
11 |
|
|
|
|
|
|
|
|
|
12 |
app = Flask(__name__)
|
13 |
|
14 |
MAX_LENGTH = 38
|
15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
def format_tesseract_output(output_text):
|
17 |
formatted_text = ""
|
18 |
lines = output_text.strip().split("\n")
|