Spaces:
Sleeping
Sleeping
Create app.py
Browse files
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()
|