Spaces:
Running on Zero
Running on Zero
Apply patches for donut encoder prune_heads and pymupdf imports
Browse files- app.py +1 -1
- layout_profiler.py +1 -1
- requirements.txt +1 -0
app.py
CHANGED
|
@@ -313,7 +313,7 @@ def process_pdf(
|
|
| 313 |
# We scale them to 72 dpi using the ratio (overlay_w / det_img_w).
|
| 314 |
overlay_image: Optional[Image.Image] = None
|
| 315 |
try:
|
| 316 |
-
import
|
| 317 |
doc = fitz.open(pdf_path)
|
| 318 |
first_page = doc[0]
|
| 319 |
mat = fitz.Matrix(1.0, 1.0) # 72 dpi — 1 pt == 1 px
|
|
|
|
| 313 |
# We scale them to 72 dpi using the ratio (overlay_w / det_img_w).
|
| 314 |
overlay_image: Optional[Image.Image] = None
|
| 315 |
try:
|
| 316 |
+
import fitz
|
| 317 |
doc = fitz.open(pdf_path)
|
| 318 |
first_page = doc[0]
|
| 319 |
mat = fitz.Matrix(1.0, 1.0) # 72 dpi — 1 pt == 1 px
|
layout_profiler.py
CHANGED
|
@@ -208,7 +208,7 @@ from dataclasses import dataclass, field
|
|
| 208 |
from pathlib import Path
|
| 209 |
from typing import Dict, List, Optional, Set, Tuple
|
| 210 |
|
| 211 |
-
import
|
| 212 |
import numpy as np
|
| 213 |
|
| 214 |
|
|
|
|
| 208 |
from pathlib import Path
|
| 209 |
from typing import Dict, List, Optional, Set, Tuple
|
| 210 |
|
| 211 |
+
import fitz
|
| 212 |
import numpy as np
|
| 213 |
|
| 214 |
|
requirements.txt
CHANGED
|
@@ -2,6 +2,7 @@
|
|
| 2 |
transformers
|
| 3 |
torch
|
| 4 |
torchvision
|
|
|
|
| 5 |
numpy<2.0.0
|
| 6 |
opencv-python
|
| 7 |
gradio>=4.0.0
|
|
|
|
| 2 |
transformers
|
| 3 |
torch
|
| 4 |
torchvision
|
| 5 |
+
pymupdf>=1.23.0
|
| 6 |
numpy<2.0.0
|
| 7 |
opencv-python
|
| 8 |
gradio>=4.0.0
|