prthm11 commited on
Commit
1145c47
·
verified ·
1 Parent(s): a419e21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -638,8 +638,8 @@ def extract_images_from_pdf(pdf_path, final_json_path_2):
638
  extracted_image_subdir = os.path.join(
639
  DETECTED_IMAGE_DIR, pdf_filename)
640
  json_subdir = os.path.join(JSON_DIR, pdf_filename)
641
- os.makedirs(extracted_image_subdir, exist_ok=True)
642
- os.makedirs(json_subdir, exist_ok=True)
643
 
644
  # Output paths
645
  output_json_path = os.path.join(json_subdir, "extracted.json")
@@ -1100,12 +1100,13 @@ def process_pdf():
1100
  # Generate Random UUID for project folder name #
1101
  # ================================================= #
1102
  project_id = str(uuid.uuid4()).replace('-', '')
1103
- project_folder = os.path.join("outputs", f"{project_id}")
 
1104
 
1105
  # =========================================================================== #
1106
  # Create empty json in project_{random_id} folder #
1107
  # =========================================================================== #
1108
- os.makedirs(project_folder, exist_ok=True)
1109
 
1110
  # Save the uploaded PDF temporarily
1111
  filename = secure_filename(pdf_file.filename)
 
638
  extracted_image_subdir = os.path.join(
639
  DETECTED_IMAGE_DIR, pdf_filename)
640
  json_subdir = os.path.join(JSON_DIR, pdf_filename)
641
+ # os.makedirs(extracted_image_subdir, exist_ok=True)
642
+ # os.makedirs(json_subdir, exist_ok=True)
643
 
644
  # Output paths
645
  output_json_path = os.path.join(json_subdir, "extracted.json")
 
1100
  # Generate Random UUID for project folder name #
1101
  # ================================================= #
1102
  project_id = str(uuid.uuid4()).replace('-', '')
1103
+ project_folder = os.path.join("outputs", f"{project_id}")
1104
+
1105
 
1106
  # =========================================================================== #
1107
  # Create empty json in project_{random_id} folder #
1108
  # =========================================================================== #
1109
+ #os.makedirs(project_folder, exist_ok=True)
1110
 
1111
  # Save the uploaded PDF temporarily
1112
  filename = secure_filename(pdf_file.filename)