Update app.py
Browse files
app.py
CHANGED
@@ -4,12 +4,14 @@ from skimage.metrics import structural_similarity as ssim
|
|
4 |
import gradio as gr
|
5 |
import pytesseract
|
6 |
|
|
|
7 |
# Function to calculate SSIM between two images
|
8 |
def calculate_ssim(img1, img2):
|
9 |
-
img1_gray = img1.convert("L")
|
10 |
-
img2_gray = img2.convert("L")
|
11 |
return ssim(img1_gray, img2_gray)
|
12 |
|
|
|
13 |
# Function to extract text from an image using OCR
|
14 |
def extract_text(image):
|
15 |
image = Image.open(image)
|
|
|
4 |
import gradio as gr
|
5 |
import pytesseract
|
6 |
|
7 |
+
|
8 |
# Function to calculate SSIM between two images
|
9 |
def calculate_ssim(img1, img2):
|
10 |
+
img1_gray = Image.open(img1).convert("L")
|
11 |
+
img2_gray = Image.open(img2).convert("L")
|
12 |
return ssim(img1_gray, img2_gray)
|
13 |
|
14 |
+
|
15 |
# Function to extract text from an image using OCR
|
16 |
def extract_text(image):
|
17 |
image = Image.open(image)
|