Skip to content

Commit 0bf623a

Browse files
path change
1 parent 1194690 commit 0bf623a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python_Code/0.Handwritten_to_text.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def pdf_to_images(pdf_path, output_folder):
2525
substring_to_remove = "Scanned by CamScanner"
2626

2727
for i in range(4):
28-
pdf_path = f'Files/notes_pdf/module_{i+1}.pdf'
29-
output_folder = f'Files/OutputImages'
28+
pdf_path = f'Local_Storage/notes_pdf/module_{i+1}.pdf'
29+
output_folder = f'images/Notes_images'
3030

3131
# Convert the PDF to images and save them in the output folder
3232
image_paths, noImg = pdf_to_images(pdf_path, output_folder)
@@ -37,7 +37,7 @@ def pdf_to_images(pdf_path, output_folder):
3737
image_contents = " "
3838

3939
for j in range(noImg):
40-
image_path = f'Files/OutputImages/Module_{i+1}/page_{j+1}.jpeg'
40+
image_path = f'images/Notes_images/Module_{i+1}/page_{j+1}.jpeg'
4141
with open(image_path, 'rb') as image_file:
4242
content = image_file.read()
4343
image = vision.Image(content=content)
@@ -47,7 +47,7 @@ def pdf_to_images(pdf_path, output_folder):
4747
image_contents += text.replace(substring_to_remove, "")
4848

4949

50-
output_file = f"Files/notes_txt/module{i+1}.txt"
50+
output_file = f"Local_Storage/notes_txt/module{i+1}.txt"
5151

5252
# Write the text content to the output file
5353
with open(output_file, "w") as file:

0 commit comments

Comments
 (0)