From 70ca941ac93edadbdcd4c6b569b819bd5d9a736d Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Mon, 25 Nov 2024 11:55:39 +0000 Subject: [PATCH] linux "fix" --- app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.py b/app.py index 14d0786..c1d6147 100644 --- a/app.py +++ b/app.py @@ -21,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 @@ -169,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)