Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import
|
3 |
import pytesseract
|
4 |
import cv2
|
5 |
import numpy as np
|
6 |
from PIL import Image
|
7 |
from huggingface_hub import login
|
8 |
|
9 |
-
login()
|
10 |
|
11 |
# Load the model
|
12 |
-
|
|
|
13 |
|
14 |
# Function to extract text from image using OCR
|
15 |
def extract_text_from_image(image_file):
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import AutoProcessor, AutoModelForPreTraining
|
3 |
import pytesseract
|
4 |
import cv2
|
5 |
import numpy as np
|
6 |
from PIL import Image
|
7 |
from huggingface_hub import login
|
8 |
|
9 |
+
login(HF_token)
|
10 |
|
11 |
# Load the model
|
12 |
+
processor = AutoProcessor.from_pretrained("google/paligemma-3b-mix-224")
|
13 |
+
model = AutoModelForPreTraining.from_pretrained("google/paligemma-3b-mix-224")
|
14 |
|
15 |
# Function to extract text from image using OCR
|
16 |
def extract_text_from_image(image_file):
|