fixed
Browse files- ocr_utils.py +6 -1
ocr_utils.py
CHANGED
|
@@ -3,7 +3,12 @@ import os
|
|
| 3 |
|
| 4 |
# Initialize the OCR reader once to save time
|
| 5 |
# 'en' is for English language
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def extract_keywords_from_report(file_path):
|
| 9 |
"""
|
|
|
|
| 3 |
|
| 4 |
# Initialize the OCR reader once to save time
|
| 5 |
# 'en' is for English language
|
| 6 |
+
# In ocr_utils.py
|
| 7 |
+
# Set model_storage_directory to a folder inside your writable app directory (/app)
|
| 8 |
+
MODELS_DIR = os.path.join(os.getcwd(), 'easyocr_models')
|
| 9 |
+
os.makedirs(MODELS_DIR, exist_ok=True) # Ensure the directory exists
|
| 10 |
+
|
| 11 |
+
reader = easyocr.Reader(['en'], model_storage_directory=MODELS_DIR)
|
| 12 |
|
| 13 |
def extract_keywords_from_report(file_path):
|
| 14 |
"""
|