Skip to content

Commit

Permalink
Commented out most of OCR code for debugging and to test how text sho…
Browse files Browse the repository at this point in the history
…ws up in .txt file for each upload
  • Loading branch information
c-bommu committed Nov 11, 2023
1 parent 6ca2c5d commit 8c53706
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
15 changes: 14 additions & 1 deletion ACMAS/app/ACMAS_Web/ocr_files/ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -60,4 +73,4 @@ def ocr_driver(pdf_name):
images = pdf_name
ocr_output = run_ocr(images)
return ocr_output

'''
2 changes: 1 addition & 1 deletion ACMAS/app/ACMAS_Web/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion ACMAS/app/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c53706

Please sign in to comment.