Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -60,10 +60,10 @@ def mobilenet_similarity(img1, img2):
|
|
60 |
|
61 |
sim = cosine_similarity(feat1, feat2)[0][0] # Valor entre -1 e 1
|
62 |
sim_score = (sim + 1) * 50 # Escalar para 0-100
|
63 |
-
|
64 |
return sim_score
|
65 |
except Exception as e:
|
66 |
-
|
67 |
return 0
|
68 |
|
69 |
def load_image(source):
|
|
|
60 |
|
61 |
sim = cosine_similarity(feat1, feat2)[0][0] # Valor entre -1 e 1
|
62 |
sim_score = (sim + 1) * 50 # Escalar para 0-100
|
63 |
+
print(f"MobileNet similarity score is {sim_score}")
|
64 |
return sim_score
|
65 |
except Exception as e:
|
66 |
+
lprint("Erro ao calcular similaridade com MobileNet", exc_info=True)
|
67 |
return 0
|
68 |
|
69 |
def load_image(source):
|