Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,12 @@ from PIL import Image
|
|
4 |
import torch
|
5 |
import pytesseract
|
6 |
from transformers import AutoImageProcessor, AutoModelForObjectDetection
|
|
|
7 |
|
|
|
|
|
|
|
|
|
8 |
# Load the processor and model for table structure recognition
|
9 |
processor = AutoImageProcessor.from_pretrained("microsoft/table-transformer-structure-recognition")
|
10 |
model = AutoModelForObjectDetection.from_pretrained("microsoft/table-transformer-structure-recognition")
|
|
|
4 |
import torch
|
5 |
import pytesseract
|
6 |
from transformers import AutoImageProcessor, AutoModelForObjectDetection
|
7 |
+
import os
|
8 |
|
9 |
+
os.system('chmod 777 /tmp')
|
10 |
+
os.system('apt-get update -y')
|
11 |
+
os.system('apt-get install tesseract-ocr -y')
|
12 |
+
os.system('pip install -q pytesseract')
|
13 |
# Load the processor and model for table structure recognition
|
14 |
processor = AutoImageProcessor.from_pretrained("microsoft/table-transformer-structure-recognition")
|
15 |
model = AutoModelForObjectDetection.from_pretrained("microsoft/table-transformer-structure-recognition")
|