Compare commits
No commits in common. "a052aac26d301e705a8ec8a80c715b7b89be9e99" and "70ca941ac93edadbdcd4c6b569b819bd5d9a736d" have entirely different histories.
a052aac26d
...
70ca941ac9
5
app.py
5
app.py
@ -14,8 +14,6 @@ from paddleocr import PaddleOCR
|
||||
from PIL import Image
|
||||
import numpy as np
|
||||
|
||||
os.environ["OMP_NUM_THREADS"] = "1"
|
||||
os.environ["MKL_NUM_THREADS"] = "1"
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(
|
||||
@ -23,8 +21,6 @@ app.config.from_object(
|
||||
)
|
||||
cache = Cache(app, config={"CACHE_TYPE": "SimpleCache"})
|
||||
|
||||
ocr = PaddleOCR(use_angle_cls=True, lang='en') # Adjust language if needed
|
||||
|
||||
app.config['SESSION_COOKIE_SECURE'] = True # Only send cookie over HTTPS
|
||||
app.config['SESSION_COOKIE_HTTPONLY'] = True # Prevent JavaScript access
|
||||
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax' # Adjust for cross-site requests
|
||||
@ -171,6 +167,7 @@ def OCRupload():
|
||||
# Get the uploaded file
|
||||
file = request.files['image']
|
||||
try:
|
||||
ocr = PaddleOCR(use_angle_cls=True, lang='en') # Adjust language if needed
|
||||
image = Image.open(file.stream)
|
||||
image_np = np.array(image)
|
||||
result = ocr.ocr(image_np)
|
||||
|
Loading…
x
Reference in New Issue
Block a user