linux "fix"

This commit is contained in:
Karl Hudgell 2024-11-25 11:55:39 +00:00
parent 7c8acfb418
commit 70ca941ac9

3
app.py
View File

@ -21,8 +21,6 @@ app.config.from_object(
) )
cache = Cache(app, config={"CACHE_TYPE": "SimpleCache"}) 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_SECURE'] = True # Only send cookie over HTTPS
app.config['SESSION_COOKIE_HTTPONLY'] = True # Prevent JavaScript access app.config['SESSION_COOKIE_HTTPONLY'] = True # Prevent JavaScript access
app.config['SESSION_COOKIE_SAMESITE'] = 'Lax' # Adjust for cross-site requests app.config['SESSION_COOKIE_SAMESITE'] = 'Lax' # Adjust for cross-site requests
@ -169,6 +167,7 @@ def OCRupload():
# Get the uploaded file # Get the uploaded file
file = request.files['image'] file = request.files['image']
try: try:
ocr = PaddleOCR(use_angle_cls=True, lang='en') # Adjust language if needed
image = Image.open(file.stream) image = Image.open(file.stream)
image_np = np.array(image) image_np = np.array(image)
result = ocr.ocr(image_np) result = ocr.ocr(image_np)