Skip to content

Commit

Permalink
Update offline_topK.py
Browse files Browse the repository at this point in the history
  • Loading branch information
xukuanHIT authored Dec 3, 2021
1 parent 4c28bc6 commit c833d67
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions experiments/place_recogination/offline_topK.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,14 @@ def relocalization_offline(configs):
if k > len(scores):
k_loop_images = match_images
else:
_, indices = scores.topk(k)
indices = indices.numpy().tolist()
value, _ = scores.topk(k)
min_v = value[-1].item()
indices = []
for i_score in range(len(scores)):
if(scores[i_score] >= min_v):
indices.append(i_score)
# _, indices = scores.topk(k)
# indices = indices.numpy().tolist()
for idx in indices:
k_loop_images.append(match_images[idx])

Expand Down

0 comments on commit c833d67

Please sign in to comment.