You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMC is currently taking a long time to compute, so long that for me it takes longer on dukemtmc to do validation than to calculate the epoch.
I noticed that CMC is currently single-threaded, is it possible to make it multi-threaded?
e.g. can I pool this loop:
foriinrange(m):
# Filter out the same id and same cameravalid= ((gallery_ids[indices[i]] !=query_ids[i]) |
(gallery_cams[indices[i]] !=query_cams[i]))
ifseparate_camera_set:
# Filter out samples from same cameravalid &= (gallery_cams[indices[i]] !=query_cams[i])
ifnotnp.any(matches[i, valid]):
continueifsingle_gallery_shot:
repeat=10gids=gallery_ids[indices[i][valid]]
inds=np.where(valid)[0]
ids_dict=defaultdict(list)
forj, xinzip(inds, gids):
ids_dict[x].append(j)
else:
repeat=1for_inrange(repeat):
ifsingle_gallery_shot:
# Randomly choose one instance for each idsampled= (valid&_unique_sample(ids_dict, len(valid)))
index=np.nonzero(matches[i, sampled])[0]
else:
index=np.nonzero(matches[i, valid])[0]
delta=1./ (len(index) *repeat)
forj, kinenumerate(index):
ifk-j>=topk:
breakiffirst_match_break:
ret[k-j] +=1breakret[k-j] +=deltanum_valid_queries+=1
?
The text was updated successfully, but these errors were encountered:
@Rizhiy, thank you very much for spotting the issue. Multi-threading would definitely help. But I’m not sure if simply using Pool is Ok, as the current implementation writes to the same ret array. Maybe need to create multiple resulting CMC arrays each for a query and reduce them after the pool.
Any pull requests are welcome! I will also try to look into the problem.
CMC is currently taking a long time to compute, so long that for me it takes longer on dukemtmc to do validation than to calculate the epoch.
I noticed that CMC is currently single-threaded, is it possible to make it multi-threaded?
e.g. can I pool this loop:
?
The text was updated successfully, but these errors were encountered: