Skip to content

Commit

Permalink
Make labels unique
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaCuhel committed Mar 13, 2024
1 parent ef99c46 commit f1767d0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions datadreamer/dataset_annotation/clip_annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,15 @@ def annotate_batch(
if synonym_dict is not None:
for prob in probs:
labels.append(
np.array(
[
synonym_dict_rev[label.item()]
for label in torch.where(prob > conf_threshold)[0].numpy()
]
np.unique(
np.array(
[
synonym_dict_rev[label.item()]
for label in torch.where(prob > conf_threshold)[
0
].numpy()
]
)
)
)
else:
Expand Down

0 comments on commit f1767d0

Please sign in to comment.