Skip to content

Commit db39cf5

Browse files
committed
Fix similarity typo
1 parent c076b71 commit db39cf5

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/openvino_clip_evaluator.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
"""
2-
Copyright (c) 2024-2025 Intel Corporation
31

4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
"""
162
import os
173
import numpy as np
184
from PIL import Image
@@ -324,15 +310,15 @@ def encode_text(self, text_input):
324310

325311
def get_logits(self, image_features, zeroshot_weights):
326312
text_embeddings = np.squeeze(zeroshot_weights)
327-
simularity = []
313+
similarity = []
328314
for emb1 in image_features:
329-
temp_simularity = []
315+
temp_similarity = []
330316
for emb2 in text_embeddings:
331-
temp_simularity.append(emb1 @ emb2)
332-
simularity.append(temp_simularity)
317+
temp_similarity.append(emb1 @ emb2)
318+
similarity.append(temp_similarity)
333319

334-
simularity_tensor = torch.tensor(simularity)
335-
logits = 100. * F.softmax(simularity_tensor, dim=-1).numpy()
320+
similarity_tensor = torch.tensor(similarity)
321+
logits = 100. * F.softmax(similarity_tensor, dim=-1).numpy()
336322
return logits
337323

338324
def get_class_embeddings(self, texts, params):

0 commit comments

Comments
 (0)