Alex Strick van Linschoten commited on
Commit
36149a3
1 Parent(s): d89098d

add new temp_dir generation method

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -36,7 +36,8 @@ def predict(pdf, confidence, generate_file):
36
  document = fitz.open(pdf.name)
37
  results = []
38
  images = []
39
- tmp_dir = tempfile.gettempdir()
 
40
  for page_num, page in enumerate(document, start=1):
41
  image_pixmap = page.get_pixmap()
42
  image = image_pixmap.tobytes()
 
36
  document = fitz.open(pdf.name)
37
  results = []
38
  images = []
39
+ tmp_dir = tempfile.TemporaryDirectory().name
40
+ # tmp_dir = tempfile.gettempdir()
41
  for page_num, page in enumerate(document, start=1):
42
  image_pixmap = page.get_pixmap()
43
  image = image_pixmap.tobytes()