Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,11 @@ from PIL import Image
|
|
2 |
from transformers import LayoutLMv3ForTokenClassification, LayoutLMv3Processor
|
3 |
import gradio as gr
|
4 |
import torch
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
# Load the fine-tuned model and processor from local files
|
7 |
model_path = "./" # Path to the directory containing the uploaded model files
|
|
|
2 |
from transformers import LayoutLMv3ForTokenClassification, LayoutLMv3Processor
|
3 |
import gradio as gr
|
4 |
import torch
|
5 |
+
import pytesseract
|
6 |
+
|
7 |
+
# Set the path to the Tesseract executable
|
8 |
+
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe" # Replace with your actual Tesseract path
|
9 |
+
|
10 |
|
11 |
# Load the fine-tuned model and processor from local files
|
12 |
model_path = "./" # Path to the directory containing the uploaded model files
|