Skip to content

Commit

Permalink
fix duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
brimoor committed Dec 17, 2024
1 parent fc229b3 commit ceda3d0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fiftyone/brain/similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,9 +1181,13 @@ def find_duplicates(self, thresh=None, fraction=None):
unique_view = self._samples.select(unique_ids)

with self.use_view(unique_view):
nearest_ids, dists = self._kneighbors(
_sample_ids, _label_ids, dists = self._kneighbors(
query=duplicate_ids, k=1, return_dists=True
)
if self.config.patches_field is not None:
nearest_ids = _label_ids
else:
nearest_ids = _sample_ids

neighbors_map = defaultdict(list)
for dup_id, _ids, _dists in zip(duplicate_ids, nearest_ids, dists):
Expand Down

0 comments on commit ceda3d0

Please sign in to comment.