Spaces:
Runtime error
Runtime error
Witold Wydmański
commited on
Commit
·
010c4d7
1
Parent(s):
36324cc
fix: create flagged/ dir if not existing
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
import tempfile
|
3 |
import pytesseract
|
4 |
-
|
5 |
import fitz # PyMuPDF, imported as fitz for backward compatibility reasons
|
6 |
from PIL import Image
|
7 |
|
@@ -31,6 +31,10 @@ def tesseract_ocr(image, progress=gr.Progress()):
|
|
31 |
|
32 |
|
33 |
if __name__=="__main__":
|
|
|
|
|
|
|
|
|
34 |
iface = gr.Interface(
|
35 |
fn=tesseract_ocr,
|
36 |
inputs=[gr.File(label="PDF file")],
|
|
|
1 |
import gradio as gr
|
2 |
import tempfile
|
3 |
import pytesseract
|
4 |
+
import os
|
5 |
import fitz # PyMuPDF, imported as fitz for backward compatibility reasons
|
6 |
from PIL import Image
|
7 |
|
|
|
31 |
|
32 |
|
33 |
if __name__=="__main__":
|
34 |
+
#make sure that flagged/ dir is created
|
35 |
+
if not os.path.exists("flagged/"):
|
36 |
+
os.makedirs("flagged/")
|
37 |
+
|
38 |
iface = gr.Interface(
|
39 |
fn=tesseract_ocr,
|
40 |
inputs=[gr.File(label="PDF file")],
|