Spaces:
Running
Running
Commit
•
d0e1651
1
Parent(s):
78c79c8
Update app.py
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ cfg = OmegaConf.load("config.merged.yml")
|
|
13 |
analyzer = FaceAnalyzer(cfg.analyzer)
|
14 |
|
15 |
def gen_sim_dict_str(response: ImageData, pred_name: str = "verify", index: int = 0)-> str:
|
16 |
-
if len(response.faces) > 0
|
17 |
base_emb = response.faces[index].preds[pred_name].logits
|
18 |
sim_dict = {face.indx: cosine_similarity(base_emb, face.preds[pred_name].logits, dim=0).item() for face in response.faces}
|
19 |
sim_dict_sort = dict(sorted(sim_dict.items(), key=operator.itemgetter(1),reverse=True))
|
|
|
13 |
analyzer = FaceAnalyzer(cfg.analyzer)
|
14 |
|
15 |
def gen_sim_dict_str(response: ImageData, pred_name: str = "verify", index: int = 0)-> str:
|
16 |
+
if len(response.faces) > 0:
|
17 |
base_emb = response.faces[index].preds[pred_name].logits
|
18 |
sim_dict = {face.indx: cosine_similarity(base_emb, face.preds[pred_name].logits, dim=0).item() for face in response.faces}
|
19 |
sim_dict_sort = dict(sorted(sim_dict.items(), key=operator.itemgetter(1),reverse=True))
|