firofame commited on
Commit
e26d479
·
verified ·
1 Parent(s): 60b0ef1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+ import ocrmypdf
3
+
4
+ def ocr_pdf(input_file):
5
+ output_file = "output.pdf"
6
+ ocrmypdf.ocr(input_file, output_file, language="mal", force_ocr=True)
7
+ return output_file
8
+
9
+ interface = gradio.Interface(
10
+ fn=ocr_pdf,
11
+ inputs="file",
12
+ outputs="file"
13
+ )
14
+
15
+ interface.launch()