浏览代码

revert that fix

Karl Hudgell 1 周之前
父节点
当前提交
53d2dd2909
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app.py

+ 2 - 1
app.py

@@ -21,6 +21,8 @@ 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
@@ -167,7 +169,6 @@ 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)