diff --git a/ACMAS/app/ACMAS_Web/ocr_files/ocr.py b/ACMAS/app/ACMAS_Web/ocr_files/ocr.py index 1059e79..c548760 100644 --- a/ACMAS/app/ACMAS_Web/ocr_files/ocr.py +++ b/ACMAS/app/ACMAS_Web/ocr_files/ocr.py @@ -2,6 +2,19 @@ from pdf2image import convert_from_path import pytesseract +def ocr_driver(pdf_name): + '''if ending_type(pdf_name) == 'pdf': + images = 'Hi' + else: + images = pdf_name + ocr_output = images''' + return pdf_name + +''' +import os +from pdf2image import convert_from_path +import pytesseract + absolute_path = os.path.dirname(__file__) relative_path = "../ocr_files/lib" @@ -60,4 +73,4 @@ def ocr_driver(pdf_name): images = pdf_name ocr_output = run_ocr(images) return ocr_output - +''' diff --git a/ACMAS/app/ACMAS_Web/upload.py b/ACMAS/app/ACMAS_Web/upload.py index f44f01b..56c3b81 100644 --- a/ACMAS/app/ACMAS_Web/upload.py +++ b/ACMAS/app/ACMAS_Web/upload.py @@ -77,7 +77,7 @@ def uploadFile(self, uni, course, fType, file): stripped = fileName.split(sep, 1)[0] fileName2 = stripped + ".txt" fileText2 = ( - f"{ocr.ocr_driver(fileName)}" + f"{ocr.ocr_driver(fileName2)}" ) # Adding file to filesystem diff --git a/ACMAS/app/requirements.txt b/ACMAS/app/requirements.txt index 9e745f9..03fd0f1 100644 --- a/ACMAS/app/requirements.txt +++ b/ACMAS/app/requirements.txt @@ -9,4 +9,3 @@ gunicorn==20.1.0 pytesseract==0.3.10 pdf2image==1.16.3 poppler-utils==0.1.0 -python-poppler==0.4.1 diff --git a/requirements.txt b/requirements.txt index 9e745f9..03fd0f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,4 +9,3 @@ gunicorn==20.1.0 pytesseract==0.3.10 pdf2image==1.16.3 poppler-utils==0.1.0 -python-poppler==0.4.1