heerjtdev commited on
Commit
bc2e64c
·
verified ·
1 Parent(s): 6af814c

Update working_yolo_pipeline.py

Browse files
Files changed (1) hide show
  1. working_yolo_pipeline.py +10 -9
working_yolo_pipeline.py CHANGED
@@ -3,6 +3,7 @@ import fitz # PyMuPDF
3
  import numpy as np
4
  import cv2
5
  import torch
 
6
  import torch.serialization
7
 
8
  _original_torch_load = torch.load
@@ -2656,15 +2657,15 @@ def run_document_pipeline(input_pdf_path: str, layoutlmv3_model_path: str, struc
2656
  traceback.print_exc()
2657
  return None
2658
 
2659
- finally:
2660
- print(f"\nCleaning up temporary files in {temp_pipeline_dir}...")
2661
- try:
2662
- for f in glob.glob(os.path.join(temp_pipeline_dir, '*')):
2663
- os.remove(f)
2664
- os.rmdir(temp_pipeline_dir)
2665
- print("🧹 Cleanup successful.")
2666
- except Exception as e:
2667
- print(f"⚠️ Cleanup failed: {e}")
2668
 
2669
  total_time = time.time() - overall_start
2670
  print("\n" + "#" * 80)
 
3
  import numpy as np
4
  import cv2
5
  import torch
6
+ import torch
7
  import torch.serialization
8
 
9
  _original_torch_load = torch.load
 
2657
  traceback.print_exc()
2658
  return None
2659
 
2660
+ # finally:
2661
+ # print(f"\nCleaning up temporary files in {temp_pipeline_dir}...")
2662
+ # try:
2663
+ # for f in glob.glob(os.path.join(temp_pipeline_dir, '*')):
2664
+ # os.remove(f)
2665
+ # os.rmdir(temp_pipeline_dir)
2666
+ # print("🧹 Cleanup successful.")
2667
+ # except Exception as e:
2668
+ # print(f"⚠️ Cleanup failed: {e}")
2669
 
2670
  total_time = time.time() - overall_start
2671
  print("\n" + "#" * 80)