for k in range(n_clusters):
for i, (label, rank) in enumerate(zip(kmeans.labels_, ranks)):
if rank > bb_topk_sims[label]:
bb_topk_sims[label] = rank
bb_indices_to_show[label] = i
I don't understand the outermost for-loop. It doesn't seem to affect any computation.
Moreover, I find that this loop is taking up 80% of the total run time (another 15% is taken up by k means, so overall the GPU utilization is quite poor).
I see the following code:
https://github.com/hturki/suds/blob/main/scripts/extract_dino_correspondences.py#L96
I don't understand the outermost for-loop. It doesn't seem to affect any computation.
Moreover, I find that this loop is taking up 80% of the total run time (another 15% is taken up by k means, so overall the GPU utilization is quite poor).