Spaces:
Sleeping
Sleeping
AhmedSSabir
commited on
Commit
•
3582b44
1
Parent(s):
522466a
Update app.py
Browse files
app.py
CHANGED
@@ -87,14 +87,14 @@ def cos_sim(a, b):
|
|
87 |
|
88 |
|
89 |
|
90 |
-
def Visual_re_ranker(caption_man, caption_woman,
|
91 |
caption_man = caption_man
|
92 |
caption_woman = caption_woman
|
93 |
-
|
94 |
context_prob = context_prob
|
95 |
caption_emb_man = model_sts.encode(caption_man, convert_to_tensor=True)
|
96 |
caption_emb_woman = model_sts.encode(caption_woman, convert_to_tensor=True)
|
97 |
-
context_label_emb = model_sts.encode(
|
98 |
|
99 |
sim_m = cosine_scores = util.pytorch_cos_sim(caption_emb_man, context_label_emb)
|
100 |
sim_m = sim_m.cpu().numpy()
|
|
|
87 |
|
88 |
|
89 |
|
90 |
+
def Visual_re_ranker(caption_man, caption_woman, visual_context_label, context_prob):
|
91 |
caption_man = caption_man
|
92 |
caption_woman = caption_woman
|
93 |
+
visual_context_label = visual_context_label
|
94 |
context_prob = context_prob
|
95 |
caption_emb_man = model_sts.encode(caption_man, convert_to_tensor=True)
|
96 |
caption_emb_woman = model_sts.encode(caption_woman, convert_to_tensor=True)
|
97 |
+
context_label_emb = model_sts.encode(visual_context_label, convert_to_tensor=True)
|
98 |
|
99 |
sim_m = cosine_scores = util.pytorch_cos_sim(caption_emb_man, context_label_emb)
|
100 |
sim_m = sim_m.cpu().numpy()
|