Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,10 @@ import io
|
|
9 |
def calculate_ssim(img1, img2):
|
10 |
img1_gray = img1.convert("L")
|
11 |
img2_gray = img2.convert("L")
|
12 |
-
|
|
|
|
|
|
|
13 |
|
14 |
# Function to compare two trademarks
|
15 |
def compare_trademarks(trademark1, trademark2):
|
|
|
9 |
def calculate_ssim(img1, img2):
|
10 |
img1_gray = img1.convert("L")
|
11 |
img2_gray = img2.convert("L")
|
12 |
+
# Resize images to a common size
|
13 |
+
img1_resized = img1_gray.resize((256, 256))
|
14 |
+
img2_resized = img2_gray.resize((256, 256))
|
15 |
+
return ssim(np.array(img1_resized), np.array(img2_resized))
|
16 |
|
17 |
# Function to compare two trademarks
|
18 |
def compare_trademarks(trademark1, trademark2):
|