omar87 commited on
Commit
c1da91a
·
1 Parent(s): 0986dc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
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
- return ssim(np.array(img1_gray), np.array(img2_gray))
 
 
 
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):