Neurolingua commited on
Commit
d9a113f
1 Parent(s): ac2207a

Update student_functions.py

Browse files
Files changed (1) hide show
  1. student_functions.py +3 -1
student_functions.py CHANGED
@@ -68,7 +68,9 @@ Answer: [Option number]'''},
68
 
69
 
70
  def perform_ocr(image_path):
71
- reader = easyocr.Reader(['en'])
 
 
72
  try:
73
  result = reader.readtext(image_path)
74
  extracted_text = ''
 
68
 
69
 
70
  def perform_ocr(image_path):
71
+ model_dir = os.path.join('/app', '.EasyOCR', 'model') # Use a writable directory in the container
72
+ os.makedirs(model_dir, exist_ok=True)
73
+ reader = easyocr.Reader(['en'], model_storage_directory=model_dir)
74
  try:
75
  result = reader.readtext(image_path)
76
  extracted_text = ''