Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,6 @@ import gradio as gr
|
|
| 2 |
import requests
|
| 3 |
from pypdf import PdfReader
|
| 4 |
import pypdfium2 as pdfium
|
| 5 |
-
|
| 6 |
import easyocr
|
| 7 |
|
| 8 |
ocr_id = {
|
|
@@ -69,7 +68,7 @@ def pdf_pil(file_path,page_num):
|
|
| 69 |
pdf = pdfium.PdfDocument("data.pdf")
|
| 70 |
page = pdf.get_page(int(page_num)-1)
|
| 71 |
bitmap = page.render(
|
| 72 |
-
scale =
|
| 73 |
rotation = 0, # no additional rotation
|
| 74 |
# ... further rendering options
|
| 75 |
)
|
|
|
|
| 2 |
import requests
|
| 3 |
from pypdf import PdfReader
|
| 4 |
import pypdfium2 as pdfium
|
|
|
|
| 5 |
import easyocr
|
| 6 |
|
| 7 |
ocr_id = {
|
|
|
|
| 68 |
pdf = pdfium.PdfDocument("data.pdf")
|
| 69 |
page = pdf.get_page(int(page_num)-1)
|
| 70 |
bitmap = page.render(
|
| 71 |
+
scale = 3, # 72dpi resolution
|
| 72 |
rotation = 0, # no additional rotation
|
| 73 |
# ... further rendering options
|
| 74 |
)
|